Apache filters, gzip, and WordPress

Don’t enable WordPress’s gzip function unless:

  • you have a good reason not to use mod_deflate instead, such as wanting to compress RSS files
  • you are not using any filters of type AF_FTYPE_RESOURCE or higher in the Apache filter chain to modify the HTML afterwards.

As soon as WordPress has gzipped the content, it is impossible for any other filter to modify it. It will also be very easy to forget that you have set this option, and then you will go nuts like me trying to figure out why mod_deflate seems to be invoked so early in the filter chain — when in fact the content is being compressed by PHP itself.

Leave a Reply