View Full Version : Best compression method.

12-08-2010, 12:38 PM
I have been using compression gzip on my .htaccess. It has been working till we changed Host.
To the new Host my compression didn't worked. I believe is't an apache handler problem. I haven't setup anything on it and I don't know what to do.

Can you help me find the best compression method?
Do you have any helpful resources?
Is .htaccess a good method?

12-09-2010, 09:02 PM
You can use this on your .htaccess (<-- hidden file on you www folder)

Open for code edit --> paste this at the bottom

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex wont work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Dont compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

<IfModule mod_headers.c>
# Make sure proxies dont deliver the wrong content
Header append Vary User-Agent env=!dont-vary

If it doesn't work contact your hosting service.

If you get errors delete what you just paste and contact your hosting service.

Hope it worked for you...

PS:google webmaster tools (I think) cant see this compression!
Install pagespeed+firebug for firefox to check this if it is compressing your files.