Wednesday, June 13th, 2007
Resource Accelerate: Caching and Compression
<p>Kris Zyp has released Resource Accelerate, “a J2EE web application filter that provides three signficant performance enhancements to web applications that use CSS, JavaScript, and shared images in a simple, easy to use package.”- Caching Header Directives – this can significantly reduce the number of requests a browser needs to make for a web application when multiple pages share the same file resources.
- Gzip Compression - Resource Accelerate provides Gzip compression that can signficantly reduce the size of files that are transferred (often 60-80% for JS or CSS files).
- JavaScript Compression - Resource Accelerate can apply Dojo’s ShrinkSafe JavaScript compression as well.
Download from SourceForge.
Related Content:











Interesting, but their site has serious stability issues which I believe are related to their acceleration. Navigating around the site crashed IE6 and on Firefox popped up nasty JS alerts due to fatal errors.
We find that GZipping and Caching are much more effective (i.e. have a greater effect on download size) and more reliable than JS compression – which can occasionally cause issues, and are easy to setup manually on most web-servers. You can test the effect easily using firebug.
Ryan – Please let me know the specifics on any bugs you find on the site (kriszyp@xucia.com or on the SF project). This is beta, so I am eager to find bugs.
Marcus – Gzipping and caching certainly are safer. And yes there is nothing in RA that can not be achieved with some configuration or simple programming in most web servers (or scripts to do JS compression). However, this is targeted for Tomcat, and in my experience most Tomcat webapps do not have optimizations. Caching is also problematic to setup in Tomcat. This is intended to provide a real simple way to “plugin” a performance boost.
Nice approach.
Another possibility to compress, cache and gzip JavaScript and CSS is a JSP-Taglib called pack:tag.
It also can combine mutliple resources!
Tomcat already has Gzip compression, and I already compress and combine my JS files beforehand, but the caching should certainly help.
Daniel – pack:tag is very nice, although it doesn’t do caching directives (or gzip)
Matt – If I am not mistaken, with Tomcat Gzip compression, files get recompressed on each request. RA keeps a server-local cache so it only needs to recompress when a file is changed. This obviously reduces the load on the server (compression is CPU intensive).
re: pack:tag, at least I didn’t see anything about caching directives/headers, maybe they are there, or maybe you can add them. Pack:tag could set cache expiration date to a long time in the future with the rehashing technique you are using, which would be pretty sweet (or maybe you already do that).
Kris, thanks for that information, I guess this does have an advantage then.
Btw, I can’t get the site to load in Firefox 2.0, it loads fine in 3.0a5 though.
The similar stuff is available in JSOS: http://www.servletsuite.com/servlets.htm E.g.:
http://www.servletsuite.com/servlets/jstrimflt.htm
or
http://www.servletsuite.com/servlets/csstrimflt.htm
@Kris Zyp: I have to correct you, pack:tag does support gzip, you simply have to use the servlet-based cachetype (instead of the file-based cachetype).
Same to the caching directives, but that isn’t released to the public yet ;)
so for caching directives you have to wait until the next upcoming version.