PDA

View Full Version : Compress files using GZip



life.raghav
17 Mar 2010, 11:45 PM
Can anyone tell how to compress Javascript and CSS files using GZip? Are there any side effects by compressing these files?
Thanks in advance.

Condor
18 Mar 2010, 12:59 AM
GZip compression is usually handled by your HTTP server (e.g. Apache mod_deflate (http://httpd.apache.org/docs/2.0/mod/mod_deflate.html)).

Advantages:
1. Lower bandwidth usage.
2. Faster download times.

Disadvantages:
1. Higher CPU load on the server (only important for dynamic pages).

life.raghav
18 Mar 2010, 4:28 AM
So how do we compress the files? Do we have to add any code in .htaccess file?

steffenk
18 Mar 2010, 4:36 AM
if you work on eclipse there is a plugin doing that for you: rockstar apps