I’ve followed all the steps in multiple tutorials to enable mod_deflate in Apache but I’m still not seeing compression (in Fiddler) when I issue requests for json (via PHP script) to my local web server. Compression isn’t necessary for my browser to localhost but my machine will be periodically exposed over a slow VPN so I would like to use it.
LoadModule deflate_module modules/mod_deflate.so (not commented-out)
mod_deflate.so exists in Apache2/modules
PHP scripts immediately set the following header when run:
application/json exists in Apache2/conf/mime.types
And this is the relevant section from httpd.conf on the mime-types that should be compressed:
When I issue a request to the server the request headers include
Accept-Encoding: gzip, deflate, but the response comes back uncompressed. I have restarted Apache after every .conf change.
Any suggestions very welcome!
Wild guess here… maybe add as a new row in the config:
AddOutputFilter DEFLATE php
to the end of your exising AddOutputFilterByType list.