cheatsheet1999/FrontEndCollection

HTML5 offline storage mechanism

cheatsheet1999 opened this issue · 0 comments

Users are online

When the browser finds manifest attribute on HTML head, it will request the manifest file.

  • If this is the first time visiting,

    • Then the browser will download the corresponding resources and store data based on the manifest file.
  • If not the first time visiting,

    • Then the browser will use the offline resource to load the page, then compares the old manifest file with the new manifest file, and update the manifest file if needed

Users are offline

  • The offline storage of HTML5 is based on a .appcache file. It works somehow like Cookie, which means web data will be downloaded and show the web data when users are offline