[whatwg] Fwd: fallback section taking over for 4xx and 5xx responses while online

Mikko Rantalainen mikko.rantalainen at peda.net
Thu Dec 20 02:24:20 PST 2012


Ian Hickson, 2012-12-17 23:30 (Europe/Helsinki):
> On Tue, 11 Dec 2012, David Barrett-Kahn wrote:
>> browser that the response is not to trigger the fallback entry, despite 
>> its response code.  Something like it could be considered for 
> 
> Can you elaborate on the need for this feature? Why would you ever send 
> the user to a 404 page intentionally (i.e. when the server isn't broken)? 
> Similarly, why would you not consider the server returning 500 a good 
> indication that the cache should be used?

I'm not sure about 404 but if the UA is able to connect the server and
gets HTTP 410 Gone, I'd be pretty upset if cached offline copy would be
used automatically. The server has clearly responded that the requested
document is intentionally removed. End user seeing cached (stale) copy
instead is very far from intented result in this case.

In my opinion the UA should *always* use server returned response if
server responded at all. If UA cannot connect to the server or server
does not return any response in UA defined timeout, then use offline
version automatically. For 4xx and 5xx online responses, perhaps provide
UI to allow viewing stale offline copy instead of server response. For
example, in case of Firefox, perhaps display the yellow bar at
top-of-the-page saying that "An offline copy of this document is
available" with a button "Show offline copy".

I would be somewhat okay with 404 and 503 getting "fallback to offline
copy silently" but any other response that UA receives should be used
instead of offline copy. In both cases, I'd prefer being able to see the
actual response. For example, a well made 503 would contain human
readable information about when the service is available again.

Redirecting 4xx and 5xx responses to offline copy silently would only
work if a HTTP header such as Response-Origin: generic-http-server-error
did exist. The idea is that if the error message is generated by Apache,
IIS or some other non-application specific software, then fallback to
offline copy. In all other cases, it's probably a good idea to display
the server response.

-- 
Mikko




More information about the whatwg mailing list