File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/react-scripts/template Expand file tree Collapse file tree 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.
16281628### Opting Out of Caching
16291629
16301630If 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 ()`
16321632from [` src/ index .js ` ](src/index.js).
16331633
16341634If you had previously enabled service workers in your production deployment and
16351635have 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 ()` ,
16391643the service worker will be uninstalled. Note that depending on how ` / service- worker .js ` is served,
16401644it may take up to 24 hours for the cache to be invalidated.
16411645
You can’t perform that action at this time.
0 commit comments