Archive for November 2007
All modern browsers support GZIP compression (by sending a header to the server, Accept-Encoding: gzip). Enabling gzip server-side for HTML and XML significantly reduces the footprint of the server response which in turns improves the page load-time (latency). It also saves bandwidth costs. The cycles required to zip the response server-side and unzip it client side, are more than offset by the savings in bytes transmitted. In Tomcat 5.x, this is simply a matter of declaring gzip compression for the connector node in server.xml.
The YUI Compressor from the Yahoo UI Library is an effective and easy to use compressor for js and css files. By eliminating white spaces and shortening local variables, I have found the tool compresses files by as much as 50%. This is particularly compelling for large web properties. Smaller downloads translate into bandwidth savings and lower page latency. Translation: costs less and makes users happy! The compressor comes as an executable jar file whose commands are easily included in an Ant deployment script. This seems preferable anyways since while the compressed files have smaller footprints, they are not particularly legible. Compressing at deployment time allows developers to continue working with a original, human-readable files.
Rome is an easy to use and configure Java library for creating RSS and Atom feeds. As with all such libraries, Rome lets developers write feeds using a simple object model. Rome is responsible for producing the feed compliant XML. The product supports several flavours of RSS and Atom.
While Rome works well as a servlet, large web properties are probably better off producing feeds as a scheduled batch or background thread and saving them to the local file system for a web server to handle. This allows the application server to focus on what it does best (serve dynamic requests) while delegating the serving of static content to web servers.