|Summary:||Image cache not cleared by no-cache XHR|
|Product:||WebKit||Reporter:||Nathan Vander Wilt <natevw>|
|Component:||Page Loading||Assignee:||Nobody <webkit-unassigned>|
|Severity:||Normal||CC:||alex, ap, japhet, koivisto, mnot|
|Version:||528+ (Nightly build)|
Description Nathan Vander Wilt 2010-12-17 19:36:20 PST
According to RFC 2616 13.10 ( http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.10) , "some HTTP methods MUST cause a cache to invalidate an entity" including POST. However, issuing a POST to a URL via XMLHTTPRequest fails to cause WebKit to invalidate its cache for the requested URL. This prevents dynamic web pages from using a POST to invalidate resources (such as images) that are known by the client side scripts to have been updated.
Comment 1 Nathan Vander Wilt 2010-12-17 19:43:38 PST
Apparently this used to work in Safari circa early 2006: http://www.mnot.net/blog/2006/02/18/invalidation
Comment 2 Nathan Vander Wilt 2010-12-17 20:50:35 PST
Comment 3 Alexey Proskuryakov 2010-12-18 10:33:53 PST
Would it be possible for you to publish an example URL that shows this problem? This report doesn't appear actionable with the information currently present in it.
Comment 4 Nathan Vander Wilt 2010-12-20 18:36:31 PST
Here is a test case for the issue: http://andyet.couchone.com/share/_design/webkitBug51286/index.html To reproduce: 1. Click "Create" to add a dynamically generated div containing an image that has a random color each time it is fetched. Note this image color. 2. Click "Remove" to remove this div/image from the DOM. 3. Click "Clear" to send an XHR request for the image URL with "Cache-Control: no-cache" header set to force end-to-end reload (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4). 4. Click "Create" to dynamically generate a new image div. Compare this image color to the one noted in step #1. Expected results: New image div is a different color because any local cache stored in step #1 was invalidated in step #3. Actual results: New image div is the same color ini step #4 as it was in step #1.
Comment 5 Alexey Proskuryakov 2010-12-20 18:54:52 PST
Thanks, that makes good sense. Yes, XMLHttpRequest doesn't affect WebCore memory cache now.
Comment 7 Alexey Proskuryakov 2013-03-19 22:14:36 PDT
This is probably fixed now, as XHR uses the memory cache.