On Mon, Jul 13, 2009 at 11:41 AM, Aron Spohr<[email protected]> wrote: > Hi Christian, > > have you ever considered just making the md5 (or maybe just a shorter CRC) > part of the filename of the file you want to cache? Then you can send Expiry > headers for 6 months or a years time for those files and you'll get the same > behaviour.
FWIW, I do this. I set far-future expiry headers on my CSS and images. If I need to make a change after it's gone live, I append a query parameter with a current timestamp. There isn't anything on the other end which responds to the query param, but it does indicate that it's a new resource to the browser's caching algorithm, which is precisely what I want. The new version will then stay cached until I change the query param again. Using a hash or version number instead of a timestamp is equivalent. (I could, of course, actually hook up a script on the server-side which remembers the previous versions of the resource and will serve them up as requested, but that hasn't ever been necessary so far.) ~TJ
