When loading resources listed in fallback and/or network sections in a cache manifest file, we use webkit cache and browser cache, which could result in wrong resource used when online status changed during a browser session:
Steps to reproduce:
1. load http://htmltest.freetzi.com/fallback/index.html;
2. the image should display "online";
3. remove all network connection;
4. open a new tab and load http://htmltest.freetzi.com/fallback/index.html;
5. the image should display "offline", but it shows "online".
The reason is when we loading online.gif for the new tab, it doesn't check whether it's a fallback resource before we load it from webkit cache.
Another aspect of this issue is, we can also load fallback/network resources from browser cache, so we also need to make every load of fallback/network resources with cache policy of CachePolicyReload/ReloadIgnoringCacheData.
Created attachment 61184 [details]
patch for 42051
Created attachment 61190 [details]
patch for 42051
Updated with dummy implementation of ApplicationCacheHost::isFallbackOrNetworkResource() for Chromium port, which don't need it except for compiling purpose.
Say, there is an offline app for an image gallery, and it loads images from network, having the URLs in NETWORK section. Surely we don't want to bypass network loader cache for these, and the behavior you describe is better than the alternative.
When I last looked at the spec, it didn't say that we should bypass caches. If you think that would be a better behavior, it should probably be incorporated in the spec first.
(In reply to comment #3)
> When I last looked at the spec, it didn't say that we should bypass caches. If you think that would be a better behavior, it should probably be incorporated in the spec first.
Yeah, I agree there's no specific mentioning bypass user agent specific caches like webkit cache and webkit client application cache in the spec, but I do think without bypassing all these caches, we will give these web applications a wrong information that it's still online, while it is not, as shown my reproduce steps listed above.
A Web application can always serve the resource with pragma no-store to prevent caching if that's the way it discovers the "online" state.
Re-reading comment 3, I think that it can be misread, so to avoid confusion, my position is that the current behavior is preferable.
If you would like to change it, I think that the best thing to do would be to e-mail WHATWG or W3C HTMLWG mailing list, asking for a clarification and a possible spec change.
(In reply to comment #5)
> If you would like to change it, I think that the best thing to do would be to e-mail WHATWG or W3C HTMLWG mailing list, asking for a clarification and a possible spec change.
Good suggestion, will ask for clarification on this.
(In reply to comment #6)
Based on comments above by Alexey Proskuryakov, and comments in webkit-dev and email@example.com, I agree this bug is not valid. Offline web application should use cache-control if they want to make sure the resources in fallback list are from original server.