Bug 26681

Summary: Problem updating applicationCache when server returns 304
Product: WebKit Reporter: Kevin D. Wolf <kevinw>
Component: WebCore Misc.Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, laszlo.gombos
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows Server 2003   
URL: http://new.efficientcoder.net/2009/06/webkitsafari-application-cache-work.html
Attachments:
Description Flags
proposed fix
darin: review+
improve the fix sam: review+

Description Kevin D. Wolf 2009-06-24 08:36:47 PDT
1) Configure an application to use a manifest and window.applicationCache
2) Download initial cache, everythings works fine.  Server returns an ETag or Last-Modified date within the header.  Also has headers to disable cacheing.
3) Cache is updated, but the one or more of the resources aren't
4) WebKit requests a resource sending up If-Modified-Since and If-None-Match header headers.
5) Server returns a 304 Not Modified.
6) WebKit makes another request (goes back to step 4) this process will go on in an infinite loop.

You can see a more detailed overview at:
http://new.efficientcoder.net/2009/06/webkitsafari-application-cache-work.html
Comment 1 Mark Rowe (bdash) 2009-06-24 12:03:06 PDT
<rdar://problem/7003461>
Comment 2 Alexey Proskuryakov 2009-06-25 02:20:40 PDT
From code inspection, looks like we fail to call m_pendingEntries.remove() in ApplicationCacheGroup::didReceiveResponse() for 304 responses.
Comment 3 Alexey Proskuryakov 2009-06-25 07:24:23 PDT
Created attachment 31855 [details]
proposed fix
Comment 4 Alexey Proskuryakov 2009-06-25 21:46:40 PDT
Committed <http://trac.webkit.org/changeset/45247>. I've slightly changed the code to look more like other code paths.
Comment 5 Alexey Proskuryakov 2009-06-26 06:18:50 PDT
Tiger buildbot says this isn't quite fixed.
Comment 6 Alexey Proskuryakov 2009-06-26 06:23:14 PDT
Created attachment 31930 [details]
improve the fix
Comment 7 Alexey Proskuryakov 2009-06-26 12:39:33 PDT
Committed <http://trac.webkit.org/changeset/45275>.