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
|
!.vscode/extensions.json
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
|
/.firebase/
|
||||||
/.sass-cache
|
/.sass-cache
|
||||||
/connect.lock
|
/connect.lock
|
||||||
/coverage
|
/coverage
|
||||||
/libpeerconnection.log
|
/libpeerconnection.log
|
||||||
debug.log
|
debug.log
|
||||||
|
firebase-debug.log
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
testem.log
|
testem.log
|
||||||
/typings
|
/typings
|
||||||
|
|
|
@ -120,12 +120,25 @@
|
||||||
],
|
],
|
||||||
"headers": [
|
"headers": [
|
||||||
{
|
{
|
||||||
"source": "/",
|
// All paths (URLs without a file extension).
|
||||||
|
"source": "**/!(*.*)",
|
||||||
"headers": [
|
"headers": [
|
||||||
{
|
{"key": "Cache-Control", "value": "no-cache"},
|
||||||
"key": "Link",
|
{"key": "Link", "value": "</generated/navigation.json>;rel=preload;as=fetch,</generated/docs/index.json>;rel=preload;as=fetch"}
|
||||||
"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