chore: cache images forever to reduce vercel costs

This commit is contained in:
Nolan Lawson 2024-05-04 09:44:43 -07:00
parent 5889b404cb
commit 1ba3fed12a
3 changed files with 15 additions and 3 deletions

View File

@ -44,7 +44,13 @@ const JSON_TEMPLATE = {
}
},
{
src: '^/.*\\.(png|css|json|svg|jpe?g|map|txt|gz|webapp|woff|woff2)$',
src: '^/.*\\.(png|svg|jpe?g)$',
headers: {
'cache-control': 'public,max-age=31536000,immutable'
}
},
{
src: '^/.*\\.(css|json|map|txt|gz|webapp|woff|woff2)$',
headers: {
'cache-control': 'public,max-age=3600'
}

View File

@ -4,7 +4,7 @@
"version": "2.6.0",
"type": "module",
"engines": {
"node": "^12.20.0 || ^14.13.1 || ^16.0.0 || ^18.0.0"
"node": "^12.20.0 || ^14.13.1 || ^16.0.0 || ^18.0.0 || ^20.0.0"
},
"scripts": {
"lint": "standard && standard --plugin html 'src/routes/**/*.html'",

View File

@ -29,7 +29,13 @@
}
},
{
"src": "^/.*\\.(png|css|json|svg|jpe?g|map|txt|gz|webapp|woff|woff2)$",
"src": "^/.*\\.(png|svg|jpe?g)$",
"headers": {
"cache-control": "public,max-age=31536000,immutable"
}
},
{
"src": "^/.*\\.(css|json|map|txt|gz|webapp|woff|woff2)$",
"headers": {
"cache-control": "public,max-age=3600"
}