A beginner here so please bear with me!

I've just been assessing my websites performance and have been told that everything should be sent gzipped, namely:

The CSS files The JS files and the page itself

How do I go about doing this and should I, are there any disadvantages? Do you use it?

What happens if a browser does not support gzip? Is this possible?

Thanks to any advice in advance it's really appreicated!

  • Please tell us what web server software you are running. – Joe Koberg Dec 22 '09 at 21:17
  • I don't know much about servers, but it says this: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ I'm assuming this means Apache? – Thomas Carter Dec 22 '09 at 21:47

Typically, you can configure a web server to do the gzipping for you. A web server will usually check the headers in web requests to see if the browser accepts GZIP responses. The specifics of how you configure this depends on which type of web server you're using. Check Server Fault for advice on setting up GZIP in IIS or Apache.


Configure your web server to compress, and it will negotiate this option with the browser.

It should be transparent to your website code.

The disadvantage is increased CPU load on the server. This rarely matters for modern servers and reasonable traffic.

  • Thanks guys. Does this mean if the browser does not support gZip they will still get the contents as usual right? Sounds good, are there any other disadvantages other than increased CPU load? – Thomas Carter Dec 22 '09 at 21:25
  • The web server will not send it unless the browser states that it supports it. I can't think of many disadvantages. You might avoid compressing images, MPG/WMV media, etc, just because it is of no benefit. But it doesn't hurt either. – Joe Koberg Dec 22 '09 at 21:48
  • Thankyou very much, adding: SetOutputFilter DEFLATE to my htaccess seems to have done the trick! – Thomas Carter Dec 22 '09 at 21:57

The webserver compresses the files automatically and the webbrowser decompresses them on arrival. This is transparent to your site/code and is configured in the webserver.

Read this article for how to enable it in Internet Information Server 6.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy