Skip to content

Commit c29ae69

Browse files
committed
优化CDN缓存配置
1 parent be9f06c commit c29ae69

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

vercel.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"headers": [
88
{
99
"key": "Cache-Control",
10-
"value": "public, max-age=7776000, s-maxage=31536000, immutable"
10+
"value": "public, max-age=15768000, s-maxage=31536000, immutable"
1111
}
1212
]
1313
},
@@ -16,7 +16,7 @@
1616
"headers": [
1717
{
1818
"key": "Cache-Control",
19-
"value": "public, max-age=86400, s-maxage=86400, stale-while-revalidate=3600"
19+
"value": "public, max-age=2592000, s-maxage=2592000, stale-while-revalidate=86400, stale-if-error=3600"
2020
}
2121
]
2222
},
@@ -34,7 +34,7 @@
3434
"headers": [
3535
{
3636
"key": "Cache-Control",
37-
"value": "public, max-age=1800, s-maxage=1800, stale-while-revalidate=600"
37+
"value": "public, max-age=3600, s-maxage=10800, stale-while-revalidate=7200"
3838
}
3939
]
4040
},
@@ -43,7 +43,7 @@
4343
"headers": [
4444
{
4545
"key": "Cache-Control",
46-
"value": "public, max-age=86400, s-maxage=86400, stale-while-revalidate=3600"
46+
"value": "public, max-age=86400, s-maxage=86400, stale-while-revalidate=3600, stale-if-error=1800"
4747
}
4848
]
4949
},
@@ -52,16 +52,23 @@
5252
"headers": [
5353
{
5454
"key": "Cache-Control",
55-
"value": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=600"
55+
"value": "public, max-age=14400, s-maxage=28800, stale-while-revalidate=3600"
5656
}
5757
]
5858
},
59+
{
60+
"source": "/**/*.html",
61+
"headers": [{
62+
"key": "Cache-Control",
63+
"value": "public, max-age=60, s-maxage=300, stale-while-revalidate=3600, stale-if-error=1800"
64+
}]
65+
},
5966
{
6067
"source": "/(\\w{2})?/links",
6168
"headers": [
6269
{
6370
"key": "Cache-Control",
64-
"value": "public, max-age=600, s-maxage=600, stale-while-revalidate=300"
71+
"value": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=1800"
6572
}
6673
]
6774
},
@@ -77,7 +84,7 @@
7784
"headers": [
7885
{
7986
"key": "Cache-Control",
80-
"value": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=600"
87+
"value": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=600, stale-if-error=1800"
8188
}
8289
]
8390
}

0 commit comments

Comments
 (0)