Originally created by: MoritzLost
I'm seeing an issue where navigating to a precached route (using workbox.precacheAndRoute()) will fail and display the navigateFallback if there is a single ? without any URL parameters at the end.
That is, navigating to /some/page will work, but navigating to /some/page? will show the 404 page (navigateFallback).
I found that setting ignoreURLParametersMatching to [/.*/] (i.e. ignore all URL parameters) solves this issue. However, this is awkward. There are no actual URL parameters here, so the only way to match this case is to ignore all URL parameters. It's impossible to only match this case (? without any parameters), but not match actual parameters, or only match some parameters as far as I can tell.
Edit: Actually, looks like setting this option doesn't work at all, I'm still getting a 404 page.
Library Affected:
Browser & Platform:
All browsers
Issue or Feature Request Description:
Arguably, an empty query (only a ? at the end of the URL with nothing else) should match precached pages by default. If this isn't possible or there's some edge-case I'm not seeing, it should be possible to configure ignoreURLParametersMatching in a way that allows this case to match the precached route, but not other URL parameters.
I'm using generateSW right now. Happy to switch to injectManifest to address this. Looks like urlManipulation is the option I'm looking for? As far as I can tell this isn't available with generateSW. Still, the default behavior could be improved here.