HEAD Request Invalidates Cache |
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 Steps to reproduce the problem: 1. Instantiate an image in Javascript and assign it a src 2. Issue a HEAD request to the same image url 3. Instantiate a second image and assign it the same src See jsfiddle here: https://jsfiddle.net/3qgk6yrc/ What is the expected behavior? Instantiating the second image should not have triggered a second request. What went wrong? The HEAD request somehow invalidates the cache. The second image that is instantiated triggers an additional request (but it should have been able to use cache). With the HEAD request removed, cache is used as expected. See jsfiddle with HEAD request removed: https://jsfiddle.net/3qgk6yrc/ Did this work before? N/A Does this work in other browsers? Yes Chrome version: 69.0.3497.100 Channel: stable OS Version: OS X 10.13.6 Flash Version: This seems to work as expected in Firefox.
,
Oct 11
+yhirano, is this the expected behaviour?
,
Oct 12
The second image request in Comment #0 seems to hit Disk Cache (tested on 69.0.3497.95 Chromeos) and thus no network requests are sent. Perhaps, by skipping MemoryCache::Remove() for RawResources (which aren't added to MemoryCache) at https://codesearch.chromium.org/chromium/src/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc?type=cs&sq=package:chromium&g=0&l=869 will make the image request at Step 3 hit the MemoryCache. However, this causes the following behavior: If we have three requests to the same URL: 1. image request => fetched from network, got Payload1. 1.5 the content of the URL is updated on the server. 2. XHR GET => fetched from network, got different Payload2. 3. image request -> hit MemoryCache, and therefore got Payload1. After this, image requests will get Payload1 while XHRs will get Payload2. Is this inconsistent, or an acceptable cache behavior?
,
Oct 15
I'm not sure if it's a good behavior but I think it's an acceptable behavior and I'm leaning to closing this bug as WONTFIX. seanzarrin@, can you tell me why the expected behavior in the issue description is important for you?
,
Oct 15
,
Oct 17
I reported the issue since the behavior was not what I would have expected, but the impact does not seem too high.
,
Oct 26
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by f...@opera.com
, Oct 9Status: Untriaged (was: Unconfirmed)