Generally it should worker with the service worker, too.
Preload is mostly useful for resources that are loaded later in the chain.
In our case, the /api/jobs endpoint is called after the JS code is downloaded and processed, so it makes sense to start loading it earlier.
We're a place where coders share, stay up-to-date and grow their careers.
Is the preload method above good for service worker and main js file?
I recommend you to check: developer.mozilla.org/en-US/docs/W...
Generally it should worker with the service worker, too.
Preload is mostly useful for resources that are loaded later in the chain.
In our case, the /api/jobs endpoint is called after the JS code is downloaded and processed, so it makes sense to start loading it earlier.