File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1628,14 +1628,18 @@ that your web app is reliably fast, even on a slow or unreliable network.
1628
1628
### Opting Out of Caching
1629
1629
1630
1630
If you would prefer not to enable service workers prior to your initial
1631
- production deployment, then remove the call to ` serviceWorkerRegistration . register ()`
1631
+ production deployment, then remove the call to ` registerServiceWorker ()`
1632
1632
from [` src/ index .js ` ](src/index.js).
1633
1633
1634
1634
If you had previously enabled service workers in your production deployment and
1635
1635
have decided that you would like to disable them for all your existing users,
1636
- you can swap out the call to ` serviceWorkerRegistration .register ()` in
1637
- [` src/ index .js ` ](src/index.js) with a call to ` serviceWorkerRegistration .unregister ()` .
1638
- After the user visits a page that has ` serviceWorkerRegistration .unregister ()` ,
1636
+ you can swap out the call to ` registerServiceWorker ()` in
1637
+ [` src/ index .js ` ](src/index.js) first by modifying the service worker import:
1638
+ ` ` ` javascript
1639
+ import { unregister } from ' ./registerServiceWorker' ;
1640
+ ` ` `
1641
+ and then call ` unregister ()` instead.
1642
+ After the user visits a page that has ` unregister ()` ,
1639
1643
the service worker will be uninstalled. Note that depending on how ` / service- worker .js ` is served,
1640
1644
it may take up to 24 hours for the cache to be invalidated.
1641
1645
You can’t perform that action at this time.
0 commit comments