[Webkit-unassigned] [Bug 32829] The browser returns a blank page if the response code is HTTP 304.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 22 00:19:17 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32829





--- Comment #3 from Mark Rowe (bdash) <mrowe at apple.com>  2009-12-22 00:19:17 PST ---
I found a spare VM to install the software on and confirmed my suspicion.  The
default response for /core/index includes the following headers instructing the
browser to not cache the page:

Pragma: no-cache
Cache-control: no-cache

After tweaking the handler to force the 304 response and hitting reload I see
Safari issue a request like so:

GET /core/index HTTP/1.1
Host: 192.168.68.148:5000
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us)
AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10
Accept:
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive

Note that there are no conditional headers such as If-None-Match or
If-Modified-Since.  The server then responds with the 304 status and the
browser is left with no content to display.  This is nothing other than buggy
behavior on behalf of the web application.  You can only respond with 304 Not
Modified to a conditional query.

If you modify the application to allow caching of the resource (remove the
Pragma header, change Cache-Control to public) and expose cache validator
information (add Last-Modified and/or ETag headers) you can see that a
conditional GET will be issued in some situations.  Loading the URL in a new
tab or window is one such situation.  Following a link to the URL from a web
page is another.  Hitting the Reload button or pressing Cmd-R is not one of
those situations, as we use the explicit user action as a hint that we should
look more aggressively for new content.

Summary: the web application needs to send appropriate headers to permit
caching, cache validators so that the browser can issue conditional requests,
and only respond with “304 Not Modified” in response to a conditional request
if all of the conditions in the request are satisfied.

-- 
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