Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(gatsby-plugin-offline): specify to not HTTP-cache sw.js #10430

Merged
merged 1 commit into from
Dec 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/docs/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ JavaScript and CSS files _generated by webpack_ should also be cached forever. L

The `cache-control` header should be `cache-control: public, max-age=31536000,immutable`

The only exception to this is the file `/sw.js`, which needs to be revalidated upon each load to check if a new version of the site is available. This file is generated by `gatsby-plugin-offline` and other service worker plugins, in order to serve content offline. Its `cache-control` header should be `cache-control: public, max-age=0, must-revalidate`

## Setting up caching on different hosts

How you setup your caching depends on how you host your site. We encourage people to create Gatsby plugins per host to automate the creation of caching headers.
Expand Down