Game Development Reference
In-Depth Information
FALLBACK:
fallback.html
By using the wild card under the network section, we indicate that any resource not
specified under cache, qualified under the network section, meaning that those re-
sources are not to be cached. Any attempt to load those resources when network
access is not available will result in the fallback file being loaded instead. This is a
good option to let the user know that network access is needed without needing to
special case any extra code.
Once the manifest is parsed and all the resources are cached, all of the resources
will remain cached, until the user deletes the offline application cache data (or all of
the data cached by the browser), or the manifest is changed. Even if only a single
character changes in the manifest file, the browser will consider it to be an update,
thus, all of the resources are cached anew. Because of this, many developers write
a comment line right at the top of the manifest file that, among other optional things,
they include some sort of version number that identifies a unique version of the mani-
fest. This way, if one or more assets changes, we can force the browser to re-cache
those assets by simply changing the version number listed in the manifest file. Re-
member, the browser will only check the text in the manifest file in order to determine
if it needs to download new assets. If assets change (say, you update JavaScript
code listed in the manifest, or some graphics, or any other resource), but the mani-
fest text doesn't, those resources will not be pulled from the server, and the user
will continue to use an outdated asset in his or her application, since the assets are
loaded only from the cache.
Search WWH ::




Custom Search