Bug 24741

Summary: Add (better?) support for cached form submissions
Product: WebKit Reporter: Darin Fisher (:fishd, Google) <fishd>
Component: Page LoadingAssignee: Darin Fisher (:fishd, Google) <fishd>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, darin, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
v1 patch koivisto: review+

Darin Fisher (:fishd, Google)
Reported 2009-03-21 10:14:29 PDT
Add (better?) support for cached form submissions Presently, FrameLoader asks the network layer if it will serve a request from cache. That is a bit problematic for Chromium at least since the cache runs on a different thread such that an answer to that question now may not be valid later. Moreover, the bigger problem is that two identical form submissions could have different responses. So, it is not actually possible to determine from a ResourceRequest if a previous response to a similar ResourceRequest could be usable by this new one. Instead, I think WebCore needs a solution like the one I implemented in Mozilla. For each form submission, a unique identifier should be generated. That unique identifier should be added to the ResourceRequest (to the FormData actually) so that the ResourceHandle can use that identifier in conjunction with the URL to generate a cache key that is unique to the form submission instance. Since FormData is already stored in HistoryItem, this means that going back-n-forth through session history would result in providing the same FormData instance to ResourceHandle. That would allow it to serve up cached form submission data based on the identifier stored in the FormData object. The only change required to cross-platform code is to add an identifier field to FormData.
Attachments
v1 patch (4.11 KB, patch)
2009-03-21 16:12 PDT, Darin Fisher (:fishd, Google)
koivisto: review+
Darin Fisher (:fishd, Google)
Comment 1 2009-03-21 16:12:10 PDT
Created attachment 28826 [details] v1 patch Pretty simple. For now, this adds code that will only be used by the Chromium port, but I didn't bother surrounding the code with #if PLATFORM(CHROMIUM) because I suspect that other ports will want to adopt this approach and the added code is very minor. I'm happy to add #ifdefs if that is preferred.
Darin Fisher (:fishd, Google)
Comment 2 2009-03-21 16:15:49 PDT
My plan is to follow-up this patch with some http layout tests that hit all of the interesting edge cases (like a non-idempotent form submitted twice with the same values).
Antti Koivisto
Comment 3 2009-03-23 13:46:34 PDT
Comment on attachment 28826 [details] v1 patch r=me
Darin Fisher (:fishd, Google)
Comment 4 2009-03-23 13:49:12 PDT
Note You need to log in before you can comment on or make changes to this bug.