Service Workers – selectively choose resources

I have a simple Service Worker implementation like this: My goal is to cache all resources except the two files indicated in the urlsToCache variable, these two files should ALWAYS be requested from the network.. How can i achieve this? How can I then verify that it is actually so? Answer You can check the url of the request in fetch event handler before deciding what caching strategy to use: