Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Wednesday, May 30, 2012
How do I gzip my web files
As prescribed by Yahoo!, gzip'ng files would make your websites load faster. The problem? I don't know how :p
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. It's not always possible, though, so if you're having difficulty, post back with more details about your platform.
If you are running Java Tomcat then you set a few properties on your Connector ( in conf/server.xml ).
Specifically you set:
compressableMimeType ( what types to compress ) compression ( off | on | ) noCompressionUserAgents ( if you don't want certain agents to receive gzip, list them here )
Here's the tomcat documentation which discusses this: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
http://www.webcodingtech.com/php/gzip-compression.php
ReplyDeleteOr if you have Apache, try http://www.askapache.com/htaccess/apache-speed-compression.html
Some hosting services have an option in the control panel. It's not always possible, though, so if you're having difficulty, post back with more details about your platform.
If you are running Java Tomcat then you set a few properties on your Connector ( in conf/server.xml ).
ReplyDeleteSpecifically you set:
compressableMimeType ( what types to compress )
compression ( off | on | )
noCompressionUserAgents ( if you don't want certain agents to receive gzip, list them here )
Here's the tomcat documentation which discusses this:
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
Edit your httpd.conf file.
ReplyDeleteAdd 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
Jetty will look for gzip'd versions of static files, as well as it has a GzipFilter for dynamic content.
ReplyDeleteYou could probably pull the GzipFilter over into Tomcat if you wanted more control over compression than just Tomcat's connector-level compression...
http://docs.codehaus.org/display/JETTY/GZIP+Compression
http://developer.yahoo.com/performance/rules.html#gzip
ReplyDeleteThis is the reference if any asks me about my reference loading gzipped files
If you are using Lighttpd, there is mod_compress.
ReplyDelete