Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    53
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Best compression method.

    Hi,
    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?

  • #2
    New Coder
    Join Date
    Oct 2010
    Posts
    53
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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>

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

    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.
    Last edited by jimanji; 12-09-2010 at 09:04 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •