Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Last active March 17, 2020 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/921d79e891d84f0436886308f33827cf to your computer and use it in GitHub Desktop.
Save cecilemuller/921d79e891d84f0436886308f33827cf to your computer and use it in GitHub Desktop.
Zeit Now: Long expiration date for static assets
{
"version": 2,
"trailingSlash": true,
"headers": [
{
"source": "/(.*)\\.(js|css|map|json|ico)",
"headers" : [
{
"key" : "Cache-Control",
"value" : "public, max-age=31536000, immutable"
}
]
}
],
"redirects": [
{
"source": "/favicon.ico",
"destination": "/favicon.ico",
"statusCode": 204
}
]
}
{
"version": 2,
"routes": [
{
"src": "/(.*)\\.(js|css|map|json|ico)$",
"headers": { "Cache-Control": "public, max-age=31536000, immutable" },
"continue": true
},
{
"src": "/favicon.ico",
"dest": "/favicon.ico",
"status": 204
},
{
"handle": "filesystem"
}
]
}
@cecilemuller
Copy link
Author

Both versions work at the moment, but routes is getting deprecated in favor of properties like headers, redirects, rewrites, trailingSlash (and handle: filesystem isn't needed anymore with newer properties).

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