Skip to content Skip to sidebar Skip to footer

How Should I Structure My Html5 Manifest Given These Requirements?

I have a HTML jquerymobile App, I need to show an offline page when the user tries to load the app from their home screen. The page I want them to see is gone-offline.jsp. Problem

Solution 1:

See this question which helps:

In summary, use a manifest which looks like this:

CACHE MANIFEST
CACHE:
/gone-offline.jsp

FALLBACK:
/ /gone-offline.jsp

NETWORK:
*

Solution 2:

A manifest can have three distinct sections: CACHE, NETWORK, and FALLBACK.

CACHE: This is the default section for entries. Files listed under this header (or immediately after the CACHE MANIFEST) will be explicitly cached after they're downloaded for the first time.

NETWORK: Files listed under this section are white-listed resources that require a connection to the server. All requests to these resources bypass the cache, even if the user is offline. Wildcards may be used.

FALLBACK: An optional section specifying fallback pages if a resource is inaccessible. The first URI is the resource, the second is the fallback. Both URIs must be relative and from the same origin as the manifest file. Wildcards may be used. Note: These sections can be listed in any order and each section can appear more than one in a single manifest.

source: http://www.html5rocks.com/en/tutorials/appcache/beginner/

I'm not very familiar with HTML5 cache manifests but it looks like you want to use the NETWORK section to force some pages to refresh regardless of connection state.

Post a Comment for "How Should I Structure My Html5 Manifest Given These Requirements?"