Wednesday, June 13th, 2007

Resource Accelerate: Caching and Compression

Category: CSS, JavaScript, Utility

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.

Posted by Dion Almaer at 5:27 am

3.6 rating from 16 votes


Comments feed TrackBack URI

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.

Comment by Ryan Breen — June 13, 2007

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.

Comment by Marcus — June 13, 2007

Ryan – Please let me know the specifics on any bugs you find on the site ( 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.

Comment by Kris Zyp — June 13, 2007

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!

Comment by Daniel — June 13, 2007

Tomcat already has Gzip compression, and I already compress and combine my JS files beforehand, but the caching should certainly help.

Comment by Matt — June 13, 2007

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).

Comment by Kris Zyp — June 13, 2007

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).

Comment by Kris Zyp — June 13, 2007

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.

Comment by Matt — June 13, 2007

The similar stuff is available in JSOS: E.g.:

Comment by Dmitry — June 14, 2007

@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.

Comment by Daniel — June 16, 2007

Leave a comment

You must be logged in to post a comment.