From e9b6ba8e333ae5953633d15b010dc90a22a22f43 Mon Sep 17 00:00:00 2001 From: Vladimir Tolstikov Date: Wed, 10 Jan 2018 17:02:45 +0400 Subject: [PATCH] docs: add info about HTTP caching headers into Firebase section (#3659) --- packages/react-scripts/template/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 17b85756b4f..e5c0cf6bf77 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -2086,6 +2086,18 @@ Then run the `firebase init` command from your project’s root. You need to cho ✔ Firebase initialization complete! ``` +IMPORTANT: you need to set proper HTTP caching headers for `service-worker.js` file in `firebase.json` file or you will not be able to see changes after first deployment ([issue #2440](https://github.com/facebookincubator/create-react-app/issues/2440)). It should be added inside `"hosting"` key like next: + +``` +{ + "hosting": { + ... + "headers": [ + {"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]} + ] + ... +``` + Now, after you create a production build with `npm run build`, you can deploy it by running `firebase deploy`. ```sh