tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: how to configure Tomcat for leveraging browser caching?
Date Wed, 27 Jun 2012 15:08:53 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Subhrajyoti,

On 6/27/12 3:16 AM, Choudhury@labware.com wrote:
> Hi , I ran Google's Page Speed( 
> https://developers.google.com/speed/pagespeed/ ) on our web app to
> analyze and optimize our web site .
> 
> One of the many items under Web Performance Best Practices ( 
> https://developers.google.com/speed/docs/best-practices/caching#LeverageBrowserCaching
>  ) 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

[1] http://www.tuckey.org/urlrewrite/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/rIgUACgkQ9CaO5/Lv0PDSSwCcCn69rXiHBI3RJtjXWDbrfni+
gcQAn13BawxoC5RzD4Ot7tJBVX4ZNqnR
=/w3Y
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message