Provide API for service worker caching strategies #216
dillonkearns
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be nice to create, essentially, a type-safe wrapper for the Workbox API to give users control over the service worker caching strategy.
It should use
PagePath
s andImagePath
s, specifically, to make it as safe as possible.It might be nice to have a function that passes in each static route or image, and then you can return a cache strategy.
That Elm code can be used to just create a hardcoded list of routes and what caching strategy should be used. Although, what about forward-compatibility, since service workers could be out of date? Ideally,
elm-pages
would refresh the service worker when it's out of date, but it's something to consider.Beta Was this translation helpful? Give feedback.
All reactions