Do I need to set the cache-control header when deploying a project? #502
-
Beta Was this translation helpful? Give feedback.
Answered by
sanyuan0704
Dec 31, 2023
Replies: 1 comment
-
对于页面的静态资源,还是推荐设置 cache-control 提升页面性能。怎么操作根据具体的部署平台决定,拿 netfify 举例,里面约定了名叫 _headers 的文件,你可以把 cache-control 的配置写在里面。在 Rspress 里面,你可以将这类配置文件放到文档目录下(默认为 docs)的 public 目录中,这样部署的时候会自动把配置文件部署到服务器上。 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sanyuan0704
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
对于页面的静态资源,还是推荐设置 cache-control 提升页面性能。怎么操作根据具体的部署平台决定,拿 netfify 举例,里面约定了名叫 _headers 的文件,你可以把 cache-control 的配置写在里面。在 Rspress 里面,你可以将这类配置文件放到文档目录下(默认为 docs)的 public 目录中,这样部署的时候会自动把配置文件部署到服务器上。