Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to exclude certain files from the cache #10

Closed
JudahGabriel opened this issue Nov 22, 2017 · 4 comments
Closed

Provide a way to exclude certain files from the cache #10

JudahGabriel opened this issue Nov 22, 2017 · 4 comments

Comments

@JudahGabriel
Copy link
Contributor

JudahGabriel commented Nov 22, 2017

Continuing from issue #8, we should provide a way for users to exclude certain request patterns from the cache.

For my scenario, I need to exclude all .mp3 files. Something like:

services.AddProgressiveWebApp(new PwaOptions
{
     // Don't cache MP3s, nor any request from mycdn.com/bigfiles
     RoutesToExcludeFromCache = ".mp3, https://mycdn.com/bigfiles/"
})

Not hard set on that syntax, opened to suggestions.

@JudahGabriel
Copy link
Contributor Author

Mads, I'm willing to do the work and submit a PR for this. Are you cool with the above syntax? Or did you have a different idea how to exclude certain file types from the cache?

@JudahGabriel
Copy link
Contributor Author

Rather than a .RoutesToExcludeFromCache, I realized what I really need is a "cache only the fingerprinted resources" strategy. I'm going to submit a PR for that.

@JudahGabriel
Copy link
Contributor Author

Now that the CacheFingerprinted strategy is implemented, this issue is solved.

@bradmatt275
Copy link

I know this issue has been closed with an alternative solution, but this would be a great option to have.

For example it would be useful to exclude API calls and external requests from getting cached.

While this can be done using the CacheFingerprinted strategy it prevents additional assets from caching, unless specified manually in the pre-cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants