Bug 144386

Summary: Main resource loaded via 304 response becomes empty if reloaded by user
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, japhet
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=144416
Attachments:
Description Flags
patch darin: review+

Description Antti Koivisto 2015-04-29 05:11:41 PDT
Main resource loaded via 304 response becomes empty if reloaded by user.
Comment 1 Antti Koivisto 2015-04-29 05:12:13 PDT
<rdar://problem/18480199>
Comment 2 Antti Koivisto 2015-04-29 08:48:33 PDT
Created attachment 251953 [details]
patch
Comment 3 Darin Adler 2015-04-29 09:08:37 PDT
Comment on attachment 251953 [details]
patch

I’ve wondered about this kind of thing for years. Part of the general “what do we want to keep when we reload and what needs to start fresh” topic for requests in general. Also related is the scheme for making reloads bypass cache appropriately.

Is this needed anywhere else? Does it only affect main resources? Is there some way to tie it more closely to other ways we have to change the request in a reloading situation?
Comment 4 Antti Koivisto 2015-04-29 09:20:21 PDT
> Is this needed anywhere else? Does it only affect main resources? Is there
> some way to tie it more closely to other ways we have to change the request
> in a reloading situation?

Main document loading is a rare case where we have a long-lived ResourceRequest not owned by a CachedResource. The refactoring that moved us from entirely special main resource loading to CachedResources based loading (using CachedRawResource) is basically incomplete so we end up with weird special handling.
Comment 5 Antti Koivisto 2015-04-29 10:11:29 PDT
https://trac.webkit.org/r183555
Comment 6 Alexey Proskuryakov 2015-04-29 12:17:34 PDT
http/tests/cache/main-resource-304-reload.html fails on Windows:

https://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2Fcache%2Fmain-resource-304-reload.html
Comment 7 Antti Koivisto 2015-04-29 13:30:17 PDT
Marked it failing on Windows in http://trac.webkit.org/changeset/183573 (like most of the cache test).