Search code examples
htmlweb-applicationshtml5-appcache

HTML5 appcache: what is the NETWORK: section really for?


I can't find any case where someone doesn't want to put all their URLs in the NETWORK: section:

NETWORK: *

If a resource isn't in the CACHE: section, nor in the NETWORK: section, the resource won't be loaded. But if a resource is not in CACHE: but is in the NETWORK: section, at least it will be loaded in the case the user is online!


Solution

  • The NETWORK section allows you to white list only resources that you trust. It is a security measure. As such it is useful also for pure online apps, i.e. apps that do not make use the other two sections (CACHE, FALLBACK).

    Quote from MDN (as of 2012-10-28 CEST, with emphasis by me):

    Network entries in an application cache are essentially an "online whitelist"—URIs specified in the NETWORK section are loaded from the server instead of the cache. This lets the browser's security model protect the user from potential security breaches by limiting access to approved resources.