当前位置:网站首页>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"
}
]
}
]
}
边栏推荐
- Manage PC startup items
- Clear timer failure
- Collection of wrong questions in soft test -- morning questions in the first half of 2011
- 7-289 tag count (300 points)
- Day 007: go language string
- Redis persistence mode AOF and RDB
- Configuration and practice of shardingsphere JDBC sub database separation of read and write
- EMC rectification outline
- [sword finger offer] interview question 24 Reverse linked list
- php安全开发15用户密码修改模块
猜你喜欢

Uni app Ali font icon does not display

Tree array explanation

Hugo blog building tutorial

Collection of wrong questions in soft test -- morning questions in the first half of 2010

Collection of wrong questions in soft test -- morning questions in the first half of 2011
![[chapter 67 of the flutter problem series] the solution to the problem that the get plug-in cannot jump to the route twice in the dialog pop-up window in flutter](/img/59/0d95619ee3bba1f8992d90267d45c2.png)
[chapter 67 of the flutter problem series] the solution to the problem that the get plug-in cannot jump to the route twice in the dialog pop-up window in flutter

EIA map making - data processing + map making

小程序基础入门(黑马学习笔记)

1.4.2 Capital Market Theroy

第007天:go语言字符串
随机推荐
This Sedata uses multiple methods to dynamically modify objects and values in arrays. Object calculation properties
R: Employee turnover forecast practice
Day45. data analysis practice (1): supermarket operation data analysis
Dumi construit un blog documentaire
在线音频调节技术汇总
【Flutter 問題系列第 67 篇】在 Flutter 中使用 Get 插件在 Dialog 彈窗中不能二次跳轉路由問題的解决方案
Differences and relations between three-tier architecture and MVC
[sword finger offer] interview question 24 Reverse linked list
Clear timer failure
Redis
剑指 Offer 11. 旋转数组的最小数字-二分查找
CTFSHOW SQL注入篇(211-230)
SEO specification
Day 007: go language string
Reread the classic: end to end object detection with transformers
String full summary
web自动化测试之webdriver api总结
建模雜談系列143 數據處理、分析與决策系統開發的梳理
Et framework -22 creating serverinfo entities and events
Use ASE encryption and decryption cache encapsulation in Vue project