Skip to content

Instantly share code, notes, and snippets.

@codfish
Last active November 13, 2020 16:19
Show Gist options
  • Save codfish/f80875e8a64b1197b4bec2b77c46e080 to your computer and use it in GitHub Desktop.
Save codfish/f80875e8a64b1197b4bec2b77c46e080 to your computer and use it in GitHub Desktop.
Cache control headers for static assets with Now. http://r.codfi.sh/Ukim4l
{
"version": 2,
"name": "codfish.io",
"alias": "codfish.io",
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"routes": [
{
"src": ".*\\.(js|css|jpg|jpeg|gif|png|svg|txt|ttf|woff2|webmanifest)$",
"headers": {
"Cache-Control": "public, max-age=157680000, s-maxage=157680000"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment