[whatwg] Image cache behaviour

1 view
Skip to first unread message

Andrew Oakley

unread,
Mar 21, 2012, 5:36:37 AM3/21/12
to whatwg
I've noticed that some browsers (Firefox, Opera, IE) cache images
without following the HTTP expiry rules. This does not appear to be
permitted by the HTML5 specification.

I've got a test case for this (with explanation) here:
http://ado.is-a-geek.net/expired/tests/image_cache_test.html

Boris Zbarsky believes this behaviour is required for compatibility so
I think it is worth adding to HTML5. This was discussed on the Mozilla
bug tracker here: https://bugzilla.mozilla.org/show_bug.cgi?id=295942

How do other browsers handle this? It seems to be possible to get
Opera and IE to throw the image away by changing the src attribute on
the img.

Are there similar caches for any other type of object or is this just
images?

Boris Zbarsky

unread,
Mar 21, 2012, 9:40:38 AM3/21/12
to wha...@lists.whatwg.org
On 3/21/12 5:36 AM, Andrew Oakley wrote:
> Are there similar caches for any other type of object or is this just
> images?

Gecko has a similar (different in mechanism, but not too different in
effect) cache for stylesheets. I seem to recall that there was explicit
text about this as well, but I can't find it now. The closest I can
locate at the moment is the first paragraph at
http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch
:

If the resource is identified by an absolute URL, and the resource
is to be obtained using an idempotent action (such as an HTTP GET
or equivalent), and it is already being downloaded for other reasons
(e.g. another invocation of this algorithm), and this request would
be identical to the previous one (e.g. same Accept and Origin
headers), and the user agent is configured such that it is to reuse
the data from the existing download instead of initiating a new one,
then use the results of the existing download instead of starting a
new one.

-Boris

Reply all
Reply to author
Forward
0 new messages