Skip to content

Instantly share code, notes, and snippets.

@dbredvick
Last active September 9, 2021 18:39
Show Gist options
  • Save dbredvick/a0cdd4fd7fd803de087e70d961eb9e79 to your computer and use it in GitHub Desktop.
Save dbredvick/a0cdd4fd7fd803de087e70d961eb9e79 to your computer and use it in GitHub Desktop.
create-react-app caching on Vercel
{
"headers": [
{
"source": "/static/:slug*",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=31536000"
}
]
}
]
}
@dbredvick
Copy link
Author

In order to configure create-react-app when deployed on Vercel, add the following headers config to your vercel.json file. Config per the docs: https://create-react-app.dev/docs/production-build/#static-file-caching

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment