You are here: >


1. Short for GNU zip, Gzip as defined in RFC 1952 is a compress software program often used in Linux that was developed by Jean-Loup Gaily and Mark Alder and released on October 31, 1992. See the gzip page for further details about the command line command. Files that have been compressed with gzip will end with .gz.

2. When referring to HTTP and content-encoding, HTTP/1.1 introduced gzip as a way for a web server to compress content before sending it to the visitor. Using gzip, makes loading a page faster because of the smaller size and can also reduce overall bandwidth costs.

For example, this web page is 7.65 KB in size and the gzipped version of this page is 2.47 KB, which is a data savings of 67.71%. If you took this example, multiplied it by hundreds-of-thousands of pages, you can see how this one change can help. This example is also just the .htm file, which does not include any external .CSS files that can also be gzipped.

If you're running Apache for your webserver, gzip has been replaced by the deflate mod. To enable deflate on Apache servers add the below code to your .htaccess file.

#Compress text, HTML, JavaScript, CSS, and XML
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

#Remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

Also see: Compress, GNU, HTTP, Tarball