Question

I'm developing a website in PHP and I have large JS files that I want to compress. So, I added this in my .htaccess file:

    <FilesMatch "\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>

It works great on my local wamp server install but once I move the files on my shared server, the DEFLATE command does not work. I don't know why... mod_deflate is enabled on the webserver, aswell as bz2, gzip. I am allowed to user htaccess, I've cheched...Plus that I have other rules and commands running in htaccess. So the DEFLATE is the only one that does not work... Does anyone know why it works on my localhost and not on my webserver too ? Is there any module/extension that I need to enable on my webserver that I don't know of ?

Any ideas ?

Thank you!

Was it helpful?

Solution

Are you sure mod_deflate is loaded and available? Apache doesn’t throw an error if you set it as filter although it is not loaded.

You can use the apache_get_modules function to see what modules are loaded.

OTHER TIPS

Hmm, I guess you're right..I've checked my loaded modules with apache_get_modules() and mod_deflate wasn't there. I also checked on my localhost and mod_deflate was there. I've sent a ticket to support. I hope I'll get this done.

Thank you for your help.

Seems like a lot of shared hosting plans have disabled mod_deflate because it takes up too much CPU... at least, on the servers they cram you into.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top