Today, I was browsing around the web and found some interesting articles which are related to minify extjs on the fly. Well, if I can minify the server response and deflate it, that would be even faster to deliver to client's browser? So I decided to give it a go.

Bang~ It is faster than just minify the content. But so far I just tested with Apache server as it is most used http server in my projects. I just added the following code in my .htaccess file

# compress text, html, javascript, css, 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

By the way, you may want to enable the mod_deflate.so in your httpd.conf to make it work.

Anyway, have a look at How To Optimize Your Site With GZIP Compression. It really gives a heads up. So you may want to have a try on your projects.