如何在 Vue.js 应用程序中配置 firebase cdn / 缓存?

How to configure firebase cdn / caching in Vue.js app?

我使用 vue.js webpack 模板开发了我的项目。我想配置 firebse cdn/caching。但是不知道该怎么办..

我已经阅读了文档https://firebase.google.com/docs/hosting/manage-cache

并发现

res.set('Cache-Control', 'public, max-age=300, s-maxage=600');

待补充。但是在部署之前我在哪里添加我的 vuejs 项目。如果有人能帮助我,请。

方法 res.set 将响应的 HTTP header 字段设置为值。这个link you have provided, refers to setting the headers when using Google Cloud Functions. You can take a look at this Github link containing an example about Google Cloud Functions which include how to set these headers in NodeJS. To get more general information about res.set() and how you can set these headers in your own application, you can also take a look at the official documentation.