Wednesday, March 23, 2005
zipping along...
The first day at the new job was pretty slow, but since then we've go the opportunity to work on some fairly interesting programs while learning some of the basics of servlets and server pages. Most of our main web application pages are gzipped on return to the client. Rather than zipping these HTTP responses on a per page basis, java web containers support filters to potentially alter any incoming request or responses to the web server. I found the concept fairly similar to Aspect Oriented Programming. Its a very quick and catch-all approach effective for logging, blocking content and other uses. We have playing with using the filters as an easy method for turning on and off compression. Much to my surprise, the exercise has turned out to be far more difficult than I had imagined. The problem centers on rerouting the response to a stand-in stream (to allow any other filters to complete their task) than routing that stream to a compressed GZIP stream. So far we've been able to successfuly compress html documents however as soon as we compress the documents the handle is lost to the response object and we can't make calls to the addHeader methods to adjust the content-encoding header to gzip.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment