tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wade Chandler <>
Subject Re: [OT] Webapp upgrades and browser caching
Date Thu, 07 Oct 2004 18:21:34 GMT
Justin Ruthenbeck wrote:

> I'm looking for some advice about how to handle the following situation.
> (1) Apache 2.x in front of Tomcat 5.x
> (2) Deploy new web application.  Bunch of servlets, bunch of jsps, bunch 
> of static content (mainly js, css).
> (3) Many users use the application, during which time their browsers 
> cache lots of static content
> (4) We do a major version upgrade of the webapp, including (almost) all 
> new static content, but URLs stay the same (to alleviate 
> bookmark-maintenance requirements).
> The problem arises when the browsers continue to use their cached 
> version of the static content.  Now, the browsers eventually get 
> updated, but immediately after deployment there are huge numbers of 
> graphical and functional (js files) problems.  It seems like behavior in 
> this area is widely different amongst browsers and/or their settings.
> I have only come up with the following option:
> (1) Play with URLs.  New deployments can be deployed under
>     a different url domain like:
>     This would force browsers to get new content since the
>     content appears as totally new content to the browser.
> Aside from disabling static content caching, are there any other options 
> out there?
> Much thanks for the help!
> justin
> ______________________________________________
> Justin Ruthenbeck
> Lead Software Engineer, NextEngine Inc.
> justinr - AT - nextengine DOT com
> Confidential. See:
> ______________________________________________
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

For static web pages you can use a tag like this:

If the browsers still have a problem you might be able to configure 
Apache to output a header will all content called EXPIRES.  I think you 
can if I remember right from some docs I read.  You will have to look at 
Apache for that.  I'm not sure about tomcat being able to handle that or 
not, but the apache bit should prepend the header I believe.  The only 
other way would be to output all images and static pages from a servlet 
of some kind and add the header yourself to the request.  Browsers 
should honor that tag or header for all images down the line from your 
html or jsp pages, but may not.

Some browsers may be able to be set to ignore this all together though. 
  Sometimes it is even worse than that.  I have seen ISP's who think 
they are slick who install a cache in their systems, and they basically 
become a proxy for the users.  If they are ignoring such things your 
users would have to contact them.  I have seen some who do this for 
different protocols even http and https differently.  That one irked me 
pretty good.

Anyways, I use expires in all my jsp and html files.  I haven't ever 
tried the other stuff for the headers from Apache, but think I remember 
reading about it in the Apache docs.  I have output that header from 
servlets and ISAPI dlls before.

Someone else may be able to offer more help.


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

View raw message