-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Skip cache on certain errors on network-first requests #324
Comments
@BowlingX that would be a good feature to have, but I'm not sure how API for that would look like. Do you have any ideas? |
@BowlingX regarding returning cached assets only if the client is offline, you can do that already with responseStrategy |
@GGAlanSmithee, At least network-first (see function @NekR maybe something like:
But I will think about something. |
…dServeFromNetwork
Hi,
thank's a lot for this plugin :).
I'm wondering If it's possible to return the cached result only on certain error codes or even only if the client is offline. Right now, any error the server throws during fetch < 500 (like != ok -> https://github.com/NekR/offline-plugin/blob/master/src/misc/sw-template.js#L378) or general errors: https://github.com/NekR/offline-plugin/blob/master/src/misc/sw-template.js#L391 are forwarded to the cached version.
Could we make this configurable? I could properly provide a pull-request.
The text was updated successfully, but these errors were encountered: