Bug 5499

Summary: Page reload does not send any cache control headers
Product: WebKit Reporter: Nicolas Sandri <nicolas.sandri>
Component: Page LoadingAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Major CC: ap
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://www.apple.com
Attachments:
Description Flags
Safari load headers dump
none
Safari reload headers dump
none
Firefox load headers dump
none
Firefox reload headers dump
none
proposed fix darin: review+

Description Nicolas Sandri 2005-10-25 09:53:08 PDT
There is no difference between loading a page and reloading a page except for the local cache. Because 
headers are strictly same, cache or proxy server between client browser and http server are not 
refreshed.
The HTTP 1.1 protocol RFC describe the request directives (in 14.9.4, Cache Revalidation and Reload 
Controls) needed to refresh page content.
Since there's a growing use of NetCache by ISPs to save their bandwidth, this problem (I already 
reported two years ago using the Safari 1.0 bug report) can really be a missing function for users 
(especially if they're web developer like me).
Firefox, for example, refresh correctly the page, adding the needed directives to its requests :
   If-Modified-Since: Wed, 12 Oct 2005 17:09:46 GMT
   If-None-Match: "1a54-434d435a"
   Cache-Control: max-age=0
Since I update my website's pages, I need to use Firefox to ask the cache server to refresh its contents 
and then use Safari to see it.

When this will be corrected, the button could be renamed "Refresh" instead of "Reload" ;)
Comment 1 Nicolas Sandri 2005-10-25 10:00:05 PDT
Created attachment 4474 [details]
Safari load headers dump
Comment 2 Nicolas Sandri 2005-10-25 10:00:36 PDT
Created attachment 4475 [details]
Safari reload headers dump
Comment 3 Nicolas Sandri 2005-10-25 10:01:32 PDT
Created attachment 4476 [details]
Firefox load headers dump
Comment 4 Nicolas Sandri 2005-10-25 10:01:52 PDT
Created attachment 4477 [details]
Firefox reload headers dump
Comment 5 Joost de Valk (AlthA) 2006-02-13 16:05:24 PST
Reassigning to webkit-unassigned, to make sure more people see this.
Comment 6 Alexey Proskuryakov 2006-05-02 04:43:48 PDT
This is related to bug 7414 (shift-reload functionality).
Comment 7 Alexey Proskuryakov 2006-06-17 16:16:24 PDT
Created attachment 8891 [details]
proposed fix

This fixes both manual reload and window.location.reload; not sure if there are other ways to cause reload that should send cache control headers (window.location.assign to the same URL doesn't do that in Firefox).

Unfortunately, there doesn't seem to be a way to send If-Modified-Since together with max-age=0 (in other words, to validate freshness) with NSURLRequest, rdar://4590785. This doesn't affect correctness, but wastes bandwidth.

The TransferJob-related code in WebCore::Frame seemed to be unused, other than for passing response HTTP headers.
Comment 8 Darin Adler 2006-06-19 13:42:52 PDT
Comment on attachment 8891 [details]
proposed fix

r=me

I'm not sure about that FIXME in loadRequest: -- seems a little cryptic to me. It's fine to add a FIXME, but I'd like it to be more specific if possible.

Can the include of TransferJob.h be removed from Frame.cpp?
Comment 9 Alexey Proskuryakov 2006-06-19 22:18:25 PDT
Committed revision 14920.

(In reply to comment #8)
> I'm not sure about that FIXME in loadRequest: -- seems a little cryptic to me.
> It's fine to add a FIXME, but I'd like it to be more specific if possible.

Changed the wording and also the meaning. There's probably nothing else needed to reset, but doing this in loadRequest: looks a bit hackish to me.

> Can the include of TransferJob.h be removed from Frame.cpp?

My patch was already removing it - am I missing something?