How a service worker works
The service worker is a JavaScript file that the browser installs next to the page. It sits in the middle of every request the page makes and decides whether to answer from the network or from the saved storage. It only works on https pages, or on localhost while you're developing.
This course uses one with three rules. Pages are requested from the network first and then from storage, so a corrected text shows up right away. Other files are taken from storage first. Models live in a separate storage that stays even when a new version of the site comes out, so they don't get downloaded again every time.