Skip to content

Commit 359a255

Browse files
bobrosoftgaearon
authored andcommitted
docs: add info about HTTP caching headers into Firebase section (facebook#3659)
1 parent 8dbb7c7 commit 359a255

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

template/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -2086,6 +2086,18 @@ Then run the `firebase init` command from your project’s root. You need to cho
20862086
✔ Firebase initialization complete!
20872087
```
20882088

2089+
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:
2090+
2091+
```
2092+
{
2093+
"hosting": {
2094+
...
2095+
"headers": [
2096+
{"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]}
2097+
]
2098+
...
2099+
```
2100+
20892101
Now, after you create a production build with `npm run build`, you can deploy it by running `firebase deploy`.
20902102

20912103
```sh

0 commit comments

Comments
 (0)