Search code examples
htmlmanifestfallbackhtml5-appcache

HTML5 Application Cache Manifest - index fallback without catchall


I'm delivering a manifest for my app that looks something like this

CACHE MANIFEST
#1359542586541

NETWORK:
*
FALLBACK:
/ /index.offline

When offline, it works correctly by returning index.offline on the index path, however it has the side-effect of returning index.offline for every other resource as well. i.e. The / pattern is acting as a catchall.

Is there any way of matching the index page without everything else so only the homepage uses the fallback?

One irritation this causes is that it seems to return index.offline whenever a request returns a 500 status


Solution

  • No, the first URL in a FALLBACK is a prefix match. The only way is to always use the explicit index page rather than rely on default documents:

    FALLBACK:
    /index.html /index.offline
    

    There was a discussion of the behaviour for 500 errors on HTML5 Help mailing list last February including several responses by the spec editor, this message specifically talks about FALLBACK sections.