Zlib is enabled on Apache, but not compressing?

Discussion in 'Apache' started by xecutable, Jan 13, 2010.

  1. #1
    I have turned on zlib for compression, since my host would not activate mode_deflate!

    I have edited the .htaccess and it reads the following:

    php_flag zlib.output_compression on
    php_value zlib.output_compression_level 6
    
    AddHandler application/x-httpd-php .css
    AddHandler application/x-httpd-php .html
    AddHandler application/x-httpd-php .js
    
    php_value auto_prepend_file /my/absolute/path/ct.php
    
    php_flag short_open_tag off
    Code (markup):
    and the ct.php contains:

    <?php  
     
    $path = pathinfo($_SERVER['SCRIPT_NAME']);  
     
    if ($path['extension'] == 'css')  {  
       header('Content-type: text/css');  
    }  
     
    if ($path['extension'] == 'js')  {  
       header('Content-type: application/x-javascript');  
    }  
    ?>
    PHP:
    This is a wordpress blog, I have no idea why zlib would not compress! I used the ob_start('ob_gzhandler'); but it breaks stuff in the admin panel!

    What could be the problem, I made a simple test.php to echo the php values on the server, says Zlib enabled, zlib.output_compression On, zlib.output_compression_level6, yet nothing seems to be compressed.

    I have confirmed it via, YSlow, PageSpeed and that whatsmyip.org page
     
    xecutable, Jan 13, 2010 IP