Commit d49744f0 authored by Vladimir Tolstikov's avatar Vladimir Tolstikov Committed by Dan Abramov
Browse files

docs: add info about HTTP caching headers into Firebase section (#3659)

parent 0ec41350
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 12 additions and 0 deletions
+12 -0
...@@ -2086,6 +2086,18 @@ Then run the `firebase init` command from your project’s root. You need to cho ...@@ -2086,6 +2086,18 @@ Then run the `firebase init` command from your project’s root. You need to cho
✔ Firebase initialization complete! ✔ 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`. Now, after you create a production build with `npm run build`, you can deploy it by running `firebase deploy`.
```sh ```sh
......
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