Fetching remote resources can be done in a few different ways. In this recipe, we are going to look at two standard ways of fetching remote resources, as well as finding out how to use a service worker to act like a proxy middleware.
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 Setting up service workers recipe of Chapter 1, Learning Service Worker Basics. Service workers only run across HTTPS. To find out how to set up a development environment to support this feature, refer to the Setting up GitHub pages for SSL recipe of Chapter 1, Learning Service Worker Basics.