Last active
March 17, 2020 10:09
-
-
Save cecilemuller/921d79e891d84f0436886308f33827cf to your computer and use it in GitHub Desktop.
Zeit Now: Long expiration date for static assets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Both versions work at the moment, but
routes
is getting deprecated in favor of properties likeheaders
,redirects
,rewrites
,trailingSlash
(andhandle: filesystem
isn't needed anymore with newer properties).