The service-worker is responsible for caching the application resources in the browser to minimize incoming traffic and the correct operation of the application in case of unstable connection to the network.