-
☆ A M B ☆
- 2,213 Posts
I'm glad you found the solution for you host. The .htaccess commands will only work if your host has apache configured with the correct modules.
You could try using the code from here:
http://salscode.com/web-resources/gzip-htaccess
If you don't mind sharing who is your host should anyone else try to accomplish the same goal?
I have not used mod_gzip but here is my .htaccess I use to gzip .js, .css and other files via mod_deflate:
#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
</ifmodule>
#End Gzip
In case you are not already aware of it, Firebug is very useful for checking if downloaded content is gzipped. Click on the "Net" tab in Firebug and then do shift-f5 to get Firefox to reload all the .js and .css files so they show in the Net panel. Click the "+" next to the .js or .css file and click the "Headers" tab. If the response is gzipped you will see "Content-Encoding gzip" in the Response Headers section. I image the IE, Safari, and Chrome equivalents offer the same ability.
here is a syntax to use with file extensions, easy as pie...
<IFModule mod_deflate.c>
<filesmatch "\.(js|css|html|jpg|png|php)$">
SetOutputFilter DEFLATE
</filesmatch>
</IFModule>