My hosting provider doesn't support mod_deflate directives in .htaccess to provide compressed HTTP responses.

I am using Drupal 7 with Boost and wish to compress HTML, CSS and JS responses.

Is there another alternative to do this without .htaccess?

Compression is pretty much needed to speed up page loading. D6 had this inbuilt into boost but in D7 it's missing.
Till the feature is added there, is there any other alternative to approach compression?


bgm’s picture

Category: bug » feature
Status: Active » Closed (duplicate)
Issue tags: -boost, -compression

See: #1416214: Basic gzip support for 7x

There is partial support for compression (gzip) in boost 7.x-1.x, but there were reports of it being buggy.

To test it, download the latest -dev release, and uncomment the line near 330:

      // boost_write_file($_boost['filename'] . '.gz', gzencode($data, 9));

Please post your feedback in: #1416214: Basic gzip support for 7x

Philip_Clarke’s picture

If your host allows it then you can add the follow to .htaccess

php_flag zlib.output_compression On
php_value zlib.output_compression_level 5

or if you do a phpinfo() then you may find on shared hosting that it is common to be able to use a php.ini file in your home directory. That deals with php but not boost. If you do decide to uncomment the line then you should be aware that mainly the problems occur with Chrome as the most affected browser. Though depending on the modules your ISP is loading, then it may affect all browsers. In the previous thread #1416214: Basic gzip support for 7x there was a comparison of the module and also whether altering ForceType in .htaccess may do something to mitigate the issue.