[Webkit-unassigned] [Bug 117007] New: Memory-cached file: resources should be revalidated when accessed
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed May 29 16:07:00 PDT 2013
https://bugs.webkit.org/show_bug.cgi?id=117007
Summary: Memory-cached file: resources should be revalidated
when accessed
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: P2
Component: Page Loading
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: aestes at apple.com
CC: darin at apple.com, ap at webkit.org, koivisto at iki.fi,
beidson at apple.com, akling at apple.com
Right now we cache file: resources indefinitely in WebCore's memory cache, which means that WebCore will continue to use a cached resource even if the underlying file was changed on disk. An attempt was made to stop doing this in <https://bugs.webkit.org/show_bug.cgi?id=113626>, but simply not caching file: resources caused regressions in our test infrastructure and in third-party WebKit clients. We should find an approach that gives us the benefits of memory caching but does the right thing if the underlying file on disk changes after we've cached it.
Here are two approaches I can think of:
1) Compare file modification time to resource's response time when accessing a cached resource, and reload the resource if the file modification time is newer than the response time. This would be a simple solution, but could cause responsiveness issues if the file is hosted on a slow or non-responsive network filesystem. The typical I/O-on-the-main-thread caveats apply here.
2) Implement a revalidation check similar to what we do for HTTP revalidation. We could assume the cached resource is valid but at the same time queue a validation check on a background thread that will check file modification time. If the resource is still valid then we mark it as such and synthesize resource load callbacks, but if it isn't then we kick off a new load and replace the old cached resource with the new response. We could even paint images while validation is occurring to avoid flickering so long as we don't fire load/error events and resource load delegate callbacks more than once.
There might be other approaches that would work here, too.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list