On Tue, Apr 12, 2011 at 13:31, Tim Funk <funk...@apache.org> wrote:
[...]
>
> The second is trickier. Relying on random query string is not fun since it
> may cause some browsers/proxies to be less prone to caching which can really
> affect performance. Especially if the the query string is dynamic. An easier
> solution is to use place your scripts is a "special" directory - then use a
> rewrite (or similar) rule to access them. So that the path is dynamic (and
> somewhat bogus). For example:
> /scripts/2011-04-11-072730/dojo.js - and in this case - you can have a
> rewrite rule look for a pattern and remove it from the path and forward to
> the script and let the default servlet handle things.
>
> Then to populate "2011-04-11-072730" - you can do that one of 3 ways:
> - At build time - calculate the timestamp and replace it
> - At run time - use a configuration parameter in context.xml
> - A combo of both  - I like this one best since a build can trigger a new
> name, but sometimes you may run into situations where you don't need a build
> but you need it refreshed - so a server parameter tweak makes this easy too
> (and if savvy enough can be done via JMX to save a restart from occurring)
>

No need... Just have the server part calculate an appropriate ETag for
this case. It is no replacement for the first solution (which is, and
always will be, the best one), but it allows the client to query the
server with an If-None-Match header.

Apache does this by default with a combination of mtime and inode
number IIRC. I don't know, I never use ETags but only adapted
Cache-Control directives.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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

Reply via email to