Custom ServiceWorker config
See original GitHub issue1.0.0
added Progressive Web App support, is it possible to support custom config in near future? I really don’t want to eject
just to add runtime caching configs 😄
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Using Service Workers - Web APIs | MDN
A service worker functions like a proxy server, allowing you to modify requests and responses replacing them with items from its own cache....
Read more >Service worker configuration - Angular
This topic describes the properties of the service worker configuration file. ... This optional section enables you to specify a custom list of...
Read more >How to implement Custom Service worker in create-react-app ...
Note: This post only cover about how we can configure our custom service worker in our react app which is developed using create-react-app....
Read more >Customizing Service Workers in ReactJS Progressive Web ...
Learn how to customize Google Workbox's default behavior for a service worker in your React app. This articles explains how to modify the ......
Read more >How to build a PWA with Create-React-App and custom ...
Take a look at these GitHub issues to see why the team at CRA won't support customising the default service worker. Custom ServiceWorker...
Read more >Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Timer I just updated to the newest version, and tried to use the new PWA support as well, and there seems to be an issue with Firebase auth. Firebase auth uses the
/__/auth/handler
path, which seems to be ‘cached’ by the default config (returning the app itself). So for now I had to abandon the idea. Here’s what I believe to be a related issue, for the polymer project: https://github.com/Polymer/polymer-build/issues/35#issuecomment-245981301There are definitely use cases where folks might want something other than the default configuration. I tried to choose default configuration options that are, in general safe, with the understanding that developers who need to make changes will go through the
eject
flow and modify the configuration (which seemed to in keeping with the overall approach for this project).I don’t know how common it is for servers to use the
/__
prefix for “special” URLs that are server-rendered and shouldn’t be fulfilled via the locally cached content, but adding in the configuration optionwould account for them. Doing so would be unlikely to break anyone, and it would accommodate some of the folks upthread without forcing them to
eject
.As for the questions about configuring
runtimeCaching
, I tried to cover that in item 7 of this guide. There’s no single configuration option that’s likely to work for everyone, so using theeject
flow would be the way forward.