Closed SvenSeemann closed 7 years ago
Yeah, blacklisting vs. whitelisting is a sticky issue.
The values that you pass in are RegExp
objects, not glob patterns, so it's not too bad to negate it:
{
navigateFallbackWhitelist: [/^(?!.*attachments)/],
// other options
}
(In the currently WIP successor to this library, we'll support both white and blacklists.)
Hello everyone, i'm trying to use sw-precache on my project, but im currently struggling with the navigateFallback and navigateFallbackWhitelist.
For my static assets everything works fine, but I have a resource wich is used to download files, which should not be served by the service worker.
So I have paths like /.js, /.css, etc., wich should be cached, but everything behind /attachments/someID/download shouldn't. In my understanding I would need more something like navigateFallbackBlacklist (as negation is not supported anymore by glob).