build(docs-infra): improve caching configuration for Firebase hosting (#28785)
This will hopefully improve(/fix?) the errors discussed in #28114. See there for a more detailed discussion. PR Close #28785
This commit is contained in:
parent
6788d86709
commit
80c7aff5cc
|
@ -26,11 +26,13 @@
|
|||
!.vscode/extensions.json
|
||||
|
||||
# misc
|
||||
/.firebase/
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
debug.log
|
||||
firebase-debug.log
|
||||
npm-debug.log
|
||||
testem.log
|
||||
/typings
|
||||
|
|
|
@ -120,12 +120,25 @@
|
|||
],
|
||||
"headers": [
|
||||
{
|
||||
"source": "/",
|
||||
// All paths (URLs without a file extension).
|
||||
"source": "**/!(*.*)",
|
||||
"headers": [
|
||||
{"key": "Cache-Control", "value": "no-cache"},
|
||||
{"key": "Link", "value": "</generated/navigation.json>;rel=preload;as=fetch,</generated/docs/index.json>;rel=preload;as=fetch"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "Link",
|
||||
"value": "</generated/navigation.json>;rel=preload;as=fetch,</generated/docs/index.json>;rel=preload;as=fetch"
|
||||
}
|
||||
// Images, fonts, (non-hashed) CSS/JS files.
|
||||
"source": "**/*.@(gif|jpg|jpeg|png|svg|webp|js|css|eot|otf|ttf|ttc|woff|woff2)",
|
||||
"headers": [
|
||||
{"key": "Cache-Control", "value": "max-age=86400"} // 1 day
|
||||
]
|
||||
},
|
||||
{
|
||||
// Hashed CSS/JS files...
|
||||
"source": "**/*.+([0-9a-f]).@(css|js)",
|
||||
"headers": [
|
||||
{"key": "Cache-Control", "value": "max-age=2592000"} // 30 days
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue