W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] hash sum tags of binary files and code blocks?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 13 Jul 2009 11:55:36 -0500
Message-ID: <dd0fbad0907130955t7fd4c2ar1df85dbff6111424@mail.gmail.com>
On Mon, Jul 13, 2009 at 11:41 AM, Aron Spohr<aron at aspohr.de> 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
Received on Monday, 13 July 2009 09:55:36 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC