tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: how to configure Tomcat for leveraging browser caching?
Date Wed, 27 Jun 2012 15:08:53 GMT
Hash: SHA1


On 6/27/12 3:16 AM, wrote:
> Hi , I ran Google's Page Speed( 
> ) on our web app to
> analyze and optimize our web site .
> One of the many items under Web Performance Best Practices ( 
>  ) as listed in Page Speed says "To take advantage of the full
> benefits of caching consistently across all browsers, we recommend
> that you configure your web server to explicitly set caching
> headers and apply them to all cacheable static resources, not just
> a small subset (such as images). Cacheable resources include JS and
> CSS files, image files, and other binary object files (media files,
> PDFs, Flash files, etc.). In general, HTML is not static, and
> shouldn't be considered cacheable." How do I configure tomcat to
> achieve the same ? I know it can be done via Filters by putting
> some HTTP headers but can we do it without touching code just by
> configuration ?

It looks like you can use urlrewrite [1] with a <set> configuration to
set headers for specific URL patterns. So, technically, you need code
to do it, but you can use existing code instead of writing your own.
url-rewrite might be a bit heavy for your needs, and you may decide to
write your own simple filter.

- -chris

Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message