I recently discovered [mod_deflate], which compresses webserver content before sending it out - if you’re not using it you should really check it out. I turned it on and it worked flawlessly for me, with two exceptions.

  1. Server-side includes
    These just did not play well together out of the box…
  2. PHP and Perl “streaming” output
    I have some scripts, most notably imagescraper, that need to stream the html in the results page as it is computed, not all at once AFTER it is built, as mod_deflate requires.

Turning off [mod_deflate] is trivial. I used the no-gzip environment variable as follows:

# MDM This is to disable [mod_deflate] for imagescraper, so we don't try to compress the streaming results...
<Files images_google.pl>
    SetEnv no-gzip 1
</Files>

# MDM Drop this into a virtual host block to TURN OFF [mod_deflate], so it doesn't break SSI.
SetEnv no-gzip 1
  • del.icio.us
  • Digg
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati

This entry was posted on Saturday, November 1st, 2008 and filed under Tricks Tips Tools, Websites. Follow comments here with the RSS 2.0 feed. Post a comment or leave a trackback.

ADD YOUR TWO CENTS...
(Not published)