[Bug 20677] Unable to detect whether a file is in cache or not

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20677

--- Comment #4 from François REMY <francois.remy.dev@outlook.com> ---
(In reply to comment #3)
> How would that file get cached if it's not in the manifest?

Browser cache? A file may end up in the browser cache just by "viewing" it,
even if that "cached" state is not persisted. The browser may use some
heuristic to say whether the cached file is likely up to date or not.

Now that I think about it, maybe it would be great to have a second parameter
that express how old the cached version may be at max to be considered valid.


> Oh this is not for testing if the file is in the _current_ appcache but for
> testing if the resource is in _any_ appcache? Interesting.
> 
> That would have some pretty serious freshness complications... (what if the
> cache we have the file in is a year old? Should we still think we have it
> for the purposes of this API? What if it's more up to date than the things
> in the current appcache?)

On this one, I'll be the "user" and somebody else will do the brain :-) I guess
we should have a look at how browser cache works and try to replicate this
behavior. 

Maybe we can make the function asynchronous and it could issue a HEAD ...
If-Modified-Since request to see if the server returns a 304 response. It's
just an idea, maybe it would just be better to return false in case of old
cache. Or maybe this could also be a parameter. We should have a look at the
use cases to find out... 

Because anything related to IO is async anyway, transforming this in an async
function doesn't bother me too much.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 15 January 2013 21:33:05 UTC