Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Leo Wadsworth
Compressing javascript and css with Apache webserver
February 12, 2008 9:38 PM
Answer

Leo Wadsworth

Rank: Junior Member

Posts: 77

Join Date: November 18, 2007

Recent Posts

One thing we are trying to improve is the size of the downloads related to our implementation of Liferay. Unfortunately, the very first time people come to our site, they would be hit with a huge download - not the user experience we want!

We're using Apache webservers as front end proxies for the systems. One thing that looks like an easy win is using gzip compression on the Apache webserver as it serves the content. As near as I can tell, there are two different modules available - mod_gzip and mod_deflate.

We've got one installed (I think its mod_gzip) and it appears to be working - but only for the HTML files. I specifically want it to work with the .js files and the .css files.

Any thoughts? which one is better and why? How do I configure it so that it compresses the javascript and css?

Thanks!
Jorge Ferrer
RE: Compressing javascript and css with Apache webserver
February 24, 2008 5:56 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hi Leo,

Were you able to solve these issues? I don't know much about this module but a quick look at it's documentation shows that you can configure which extensions you want to compress. For example:

1# YES
2  mod_gzip_item_include         file       \.html$
3#
4# NO
5  mod_gzip_item_exclude         file       \.js$
6  mod_gzip_item_exclude         file       \.css$


Regarding the difference between the two modules you mention, it seems mod_deflate is included in the core Apache distribution, so I would use that unless you miss some functionality that mod_gzip provides.