Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Version string - Mobile Web Development

Get Embed Code
4 Languages

Showing Revision 1 created 01/16/2014 by Cogi-Admin.

  1. And that's why I said it's really common to
  2. have a version string in your manifest file, and you
  3. keep updating that version string. This can be quite
  4. a pain, but it isn't too hard. So once we
  5. have an app cache on the user's machine, on
  6. every subsequent load, the resources will be loaded from the
  7. app cache, even when you're online. If it's an
  8. HTML resource with the manifest For example, that master page
  9. we started with. Then we'll start an async update of
  10. that manifest file at the same time. And then continue loading
  11. the rest of the page. Now, if the manifest has been
  12. changed, the browser will update the files in a new application
  13. cache. But remember, it's already loaded the page. It may
  14. be done loading a page by this point since we do
  15. want to be offline first and we want to make sure that
  16. the page gets loaded as quickly as possible. By the time
  17. the manifest file has been downloaded in the background,
  18. the user is probably already off looking at cat
  19. videos out of the application cache. Now, you can
  20. detect when a new cache has been downloaded and there's
  21. new content available. You can listen for an update
  22. ready event on the window application cache object. The
  23. window application cache represents the application cache system. And
  24. you can get things like the status and progress and
  25. tell it specifically to do things like update
  26. the cache or swap the cache out. So
  27. you have a lot of control over the
  28. application cache. This code here checks for an
  29. update ready event, and if there is actually
  30. an update ready, then it'll actually ask the
  31. user, is it okay to reload this. And if so, it swaps the cache out and reloads.