Skip to content

Commit

Permalink
docs: add info about HTTP caching headers into Firebase section (face…
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrosoft authored and Pavel Zhytko committed Jul 10, 2018
1 parent aea6015 commit e9b6ba8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9b6ba8

Please sign in to comment.