Commit d679843d authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Add explicit "Opting Out of Caching" header (#2822)

parent 04820587
3 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file
Showing with 5 additions and 1 deletion
+5 -1
...@@ -68,6 +68,7 @@ You can find the most recent version of this guide [here](https://github.com/fac ...@@ -68,6 +68,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
- [Getting Started with Storybook](#getting-started-with-storybook) - [Getting Started with Storybook](#getting-started-with-storybook)
- [Getting Started with Styleguidist](#getting-started-with-styleguidist) - [Getting Started with Styleguidist](#getting-started-with-styleguidist)
- [Making a Progressive Web App](#making-a-progressive-web-app) - [Making a Progressive Web App](#making-a-progressive-web-app)
- [Opting Out of Caching](#opting-out-of-caching)
- [Offline-First Considerations](#offline-first-considerations) - [Offline-First Considerations](#offline-first-considerations)
- [Progressive Web App Metadata](#progressive-web-app-metadata) - [Progressive Web App Metadata](#progressive-web-app-metadata)
- [Analyzing the Bundle Size](#analyzing-the-bundle-size) - [Analyzing the Bundle Size](#analyzing-the-bundle-size)
...@@ -1562,6 +1563,8 @@ The service worker will use a [cache-first strategy](https://developers.google.c ...@@ -1562,6 +1563,8 @@ The service worker will use a [cache-first strategy](https://developers.google.c
for handling all requests for local assets, including the initial HTML, ensuring for handling all requests for local assets, including the initial HTML, ensuring
that your web app is reliably fast, even on a slow or unreliable network. that your web app is reliably fast, even on a slow or unreliable network.
### Opting Out of Caching
If you would prefer not to enable service workers prior to your initial If you would prefer not to enable service workers prior to your initial
production deployment, then remove the call to `serviceWorkerRegistration.register()` production deployment, then remove the call to `serviceWorkerRegistration.register()`
from [`src/index.js`](src/index.js). from [`src/index.js`](src/index.js).
...@@ -1571,7 +1574,8 @@ have decided that you would like to disable them for all your existing users, ...@@ -1571,7 +1574,8 @@ have decided that you would like to disable them for all your existing users,
you can swap out the call to `serviceWorkerRegistration.register()` in you can swap out the call to `serviceWorkerRegistration.register()` in
[`src/index.js`](src/index.js) with a call to `serviceWorkerRegistration.unregister()`. [`src/index.js`](src/index.js) with a call to `serviceWorkerRegistration.unregister()`.
After the user visits a page that has `serviceWorkerRegistration.unregister()`, After the user visits a page that has `serviceWorkerRegistration.unregister()`,
the service worker will be uninstalled. the service worker will be uninstalled. Note that depending on how `/service-worker.js` is served,
it make take up to 24 hours for the cache to be invalidated.
### Offline-First Considerations ### Offline-First Considerations
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment