DEV Community

Discussion on: Adding URL Search Parameters to Imports!

Collapse
 
kopseng profile image
Carl-Erik Kopseng

Here's an actual usage for you: cache busting the browser's cached resolution of module imports after it has failed. You see, browsers cache the initial loading of a module, including the failure state, so that the runtime does not have to download the same module multiple times. Unfortunately, that means an intermittent network error in your SPA will make it fail consistently.

That's why I published this library to catch those errors and retry by appending a cache busting query parameter to the module path.