-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim,

On 4/12/2011 7:31 AM, Tim Funk 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.

This is exactly what we've done in a particular case, mostly for
testing: we have a service provider that handles IVR telephone calls and
we have to provide the audio files for them to use via HTTP. They cache
all audio files so, ideally, the file is only obtained from us once (at
least once per server in the cluster, I suppose). Unfortunately, they
don't have an automated way to EXPIRE a particular cache entry, so we
invented a bogus path element that we can change to force a cache miss
and a reload. Something like this:

http://www.oursite.com/audio/version/1.wav

We have mapped /audio/*/ mapped to /audio so the "version" is just a
random string that gets ignored by the web server -- but it's important
for clients so they can properly cache.

Whenever we have to update an audio clip, we just change the version
number in the URL and the new file gets used.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2kXzsACgkQ9CaO5/Lv0PD/nACgjCDevK8RBSG+sHkUTC/dN1DE
qFMAn13KseQKN5Qw0dLPDAKRedutYcz9
=sIHp
-----END PGP SIGNATURE-----

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

Reply via email to