Traditional server-side page rendering has become a thing of the past with modern-day single page applications (SPAs). Even though server-side rendering is faster, state data will prove hard to implement with the service worker. Instead, we can request JSON data and a template, allow the service worker to take in the data and the template, and render a response page. JavaScript templating is a client-side data binding method, implemented with the use of the JavaScript language.
In order to learn more about templating, please refer the following link:
https://en.wikipedia.org/wiki/JavaScript_templating
To get started with service workers, you will need to have the service worker experiment feature turned on in your browser settings. If you have not done this yet, refer to the first recipe of Chapter 1, Learning Service Worker Basics: Setting up service workers. Service workers only run across HTTPS. To find out how to set up a development environment to support this...