Skip to content

Do I need to set the cache-control header when deploying a project? #502

Answered by sanyuan0704
allen0234 asked this question in Q&A
Discussion options

You must be logged in to vote

对于页面的静态资源,还是推荐设置 cache-control 提升页面性能。怎么操作根据具体的部署平台决定,拿 netfify 举例,里面约定了名叫 _headers 的文件,你可以把 cache-control 的配置写在里面。在 Rspress 里面,你可以将这类配置文件放到文档目录下(默认为 docs)的 public 目录中,这样部署的时候会自动把配置文件部署到服务器上。

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sanyuan0704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants