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

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
http://www.hallvord.com/

Received on Sunday, 3 July 2005 12:37:35 UTC