当前位置:网站首页>Vercel 使用 HTTP 缓存
Vercel 使用 HTTP 缓存
2022-06-13 04:23:00 【Lete乐特】
原文: https://blog.imlete.cn/article/Vercel-Use-HTTP-Cache.html
近期也是闲得无聊,就翻一翻Vercel文档,于是我发现,它居然能自定义设置响应头(静态文件部署居然可以)
在我个人的角度,我以为只有使用 ServerLess 才能用 http 的响应对象指定响应头信息,没想到 Vercel 居然可以直接通过
vercel.json
文件指定配置
那我部署的博客(或其它静态站点)岂不是可以启动 http 缓存了?
Vercel 文档: https://vercel.com/docs/project-configuration#project-configuration/headers
以下是本站的使用的vercel.json
文件信息(缓存开启了 1 天)
{
"headers": [
{
"source": "/sw.js",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=0, must-revalidate"
}
]
},
{
"source": "(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, s-maxage=86400, max-age=86400"
}
]
}
]
}
边栏推荐
- 【LeetCode】860. Change with lemonade (2 brushes for wrong questions)
- 1-72 convert string to decimal integer
- Call C function in Lua
- UE4 learning notes - functions of terrain tool
- [notes] summarize common horizontal and vertical centering methods
- How to use debounce in lodash to realize anti shake
- 1.4.2 Capital Market Theroy
- The data obtained from mongodb query data command is null
- Configuration and practice of shardingsphere JDBC sub database separation of read and write
- Webpack system learning (VIII) how contenthash can prevent browsers from using cache files
猜你喜欢
一款开源的Markdown转富文本编辑器的实现原理剖析
Introduction and use of ES6
Ultra quicksort reverse sequence pair
Principle, composition and functions of sensors of Dajiang UAV flight control system
Mongodb compass connects to the Alibaba cloud remote server database or reports an error occurred while loading instance info: command hostinfo req
2022 ICLR | CONTRASTIVE LEARNING OF IMAGE- AND STRUCTURE BASED REPRESENTATIONS IN DRUG DISCOVERY
Intervention analysis + pseudo regression
出现Could not find com.scwang.smart:refresh-layout-kernel:2.0.3.Required by: project :app 无法加载第三方包情况
2019 Blue Bridge Cup
Li Kou brush question 338 Bit count
随机推荐
Principle, composition and functions of sensors of Dajiang UAV flight control system
一款开源的Markdown转富文本编辑器的实现原理剖析
Solution to failure to download files by wechat scanning QR code
php开发博客系统的首页头部功能实现
Manage PC startup items
Et framework -22 creating serverinfo entities and events
EIA map making - data processing + map making
Clear timer failure
Uni app dynamic add style dynamic bind background image invalid
The problem that ionic3 cannot automatically install the APK package
[flutter problem Series Chapter 67] the Solution to the problem of Routing cannot be jumped again in in dialog popup Using get plug - in in flutter
String full summary
Application of dagger2 learning module (II)
Modeling discussion series 143 data processing, analysis and decision system development
Common terms of electromagnetic compatibility
Introduction to applet Basics (dark horse learning notes)
Sword finger offer 11 Minimum number of rotation array - binary lookup
CTFSHOW SQL注入篇(211-230)
JS common array methods
Express framework knowledge - Art template template, cookie, session