W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2005

[whatwg] XMLHttpRequest: should UA pretend a 304 response is a 200?

From: Hallvord Reiar Michaelsen Steen <hallvord@hallvord.com>
Date: Sun, 03 Jul 2005 21:37:35 +0200
Message-ID: <42C85A9F.24133.17BDFA5@localhost>
This suggestion is based on a real-world web app problem. The app 
requested a file and checked if the status was 200 in the 
onreadystate event handler. However, sometimes the browser would have 
the file cached and send a conditional request, and giving the app 
the 304 response caused it to malfunction.

Clearly it will cause subtle, hard-to-debug bugs in web apps if they 
look for a status 200 and the response actually is a 304. The UA 
makes the document available, of course, so why not fake the request 
and re-play the original response?

It may also be an issue with getResponseHeader / 
getAllResponseHeaders because the server may not send the expected 
headers with a 304.

So, should we not tell the JavaScript that a 304 response was 
returned, but show the original response including headers? Views?
Hallvord Reiar Michaelsen Steen
Received on Sunday, 3 July 2005 12:37:35 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:41 UTC