Article:
  Two Servlet Filters Every Web Application Should Have
Subject:   compress and cache
Date:   2003-12-02 17:42:14
From:   anonymous2
I can appreciate how your filters provide a simple way to take advantage of both compression and reverse proxy-style caching, but sending out compressed files without a Vary header can result in gzipped content ending up on a proxy server. The next hapless user to access that proxy without an Accept-encoding: gzip header will get the compressed file anyway. Of course, adding the Vary header will, in most cases, prevent the page from being cached on the proxy server and in the browser's cache. So it's hard to find a win here. Also, with these filters every cache hit will still have to have the gzip algorithm applied to it on the way out. A better solution would be to get the compressed versions in the cache, I think.