How can I use gzip for my web files

As stated in the Yahoo! gzip'ng files, your sites will load faster. Problem? I do not know how: p

+10
php .htaccess
Nov 17 '08 at 5:58
source share
9 answers

http://www.webcodingtech.com/php/gzip-compression.php

Or, if you have Apache, try http://www.askapache.com/htaccess/apache-speed-compression.html

Some hosting services have an option in the control panel. However, this is not always possible, so if you have any difficulties, send a message with detailed information about your platform.

+8
Nov 17 '08 at 6:02
source share

If you use Java Tomcat, you set several properties on your Connector (in conf / server.xml).

In particular, you install:

  • compressableMimeType (what types to compress)
  • compression (off | on |)
  • noCompressionUserAgents (if you do not want certain agents to receive gzip, list them here)

Here is the tomcat documentation that discusses the following: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

+2
Nov 17 '08 at 6:17
source share

Edit the httpd.conf file.

Add this line to load the module:

LoadModule deflate_module modules/mod_deflate.so 

Add these lines to actually compress the output:

 AddOutputFilterByType DEFLATE text/css text/html application/x-javascript application/javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
+2
Nov 17 '08 at 7:24
source share

Jetty will look for versions of static gzip'd files, and also have a GzipFilter for dynamic content.

You could probably pull GzipFilter into Tomcat if you need more control over compression than compression at the Tomcat connector level ...

http://docs.codehaus.org/display/JETTY/GZIP+Compression

+1
Aug 18 '09 at 16:19
source share

Gzip compresses your web pages and cascading style sheets before sending them to the client browser.

This significantly reduces the transfer time, since the files are much smaller.

There are various ways to configure gzip compression depending on whether you have an IIS or Apache server

Example: link.

+1
Aug 28 '13 at 9:55 on
source share

http://developer.yahoo.com/performance/rules.html#gzip

This is a link if anyone asks me about my link being downloaded by gzipped files.

0
Nov 17 '08 at 6:58
source share

If you use Lighttpd, there is mod_compress .

0
Nov 17 '08 at 7:57
source share

Seeing how most of the answers here are almost 5 years old, here are some very relevant and modern examples of links.

For example, server configurations that allow gzip / deflate compression for iis , lighthttpd , nginx and even node : https://github.com/h5bp/server-configs

For a very good current implementation of Apache mod_deflate see https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L156

0
Oct 24
source share

Gzip compresses your web pages and cascading style sheets before sending them to the client browser, another example: link

0
May 26 '14 at 8:51
source share



All Articles