Bug 52153

Summary: Consider allowing resource revalidation and reloading after initial page load
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: James Simonsen <simonjam>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bs, koivisto, simonjam, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Antti Koivisto 2011-01-10 10:44:25 PST
This test in CachedResourceLoader::determineRevalidationPolicy()

// Avoid loading the same resource multiple times for a single document, even if the cache policies would tell us to.
if (m_validatedURLs.contains(existingResource->url()))
    return Use;

means that we never revalidate a resource for a given document (except if it has Cache-control:no-store which is handled separately), no matter how expired it is.

While we don't want to load a resource multiple times during a page load we should probably allow revalidation for resources that are requested by a script after the page load has completed. This might be achieved simply be clearing (and not adding to it afterwards) m_validatedURLs when the page load completes. It would also be good to figure out what exactly other browsers do here before making any changes.
Comment 1 Antti Koivisto 2011-01-10 10:49:06 PST
Note that the current behavior has been in WebKit for a very long time so we are unlikely to fix any web sites by changing this. However it might allow better performance in some cases (since web sites could revalidate their resources instead on full reload forced by no-store).

This is probably also required if we want to have XHR in the memory cache.
Comment 2 Alexey Proskuryakov 2011-01-10 10:58:28 PST
See also: bug 51286 and bug 26226.
Comment 3 James Simonsen 2011-08-10 18:37:15 PDT
*** Bug 66020 has been marked as a duplicate of this bug. ***
Comment 4 Alexey Proskuryakov 2011-08-10 21:56:43 PDT
Per bug 66020, this is affecting Google Docs.
Comment 5 James Simonsen 2011-08-12 13:52:37 PDT
Created attachment 103811 [details]
Patch
Comment 6 Antti Koivisto 2011-08-18 08:17:05 PDT
Comment on attachment 103811 [details]
Patch

r=me
Comment 7 WebKit Review Bot 2011-08-18 11:41:42 PDT
Comment on attachment 103811 [details]
Patch

Clearing flags on attachment: 103811

Committed r93326: <http://trac.webkit.org/changeset/93326>
Comment 8 WebKit Review Bot 2011-08-18 11:41:47 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Alexey Proskuryakov 2011-09-23 11:21:09 PDT
This patch has broken MobileMe galleries, see bug 68682.