A Service Worker is a JavaScript file that acts as an intermediary server to decide which files can be served from cache and which must be fetched directly. This can improve the load time of each page and allows the application to continue to function offline. The Service Worker runs independently from the web app and continues to be available when the app is closed.
For more information about Service Workers, see the MDN documentation.