我正在创建一个部署在 firebase 上的 Angular8 通用应用程序。引用了这个网站Angular universal with firebase
当我在本地使用 Express 服务器运行并提供应用程序时,所有路由都将加载更新的元标记。当我在 firebase 上部署应用程序时,一切正常,但根路径上的元标记没有更新。它们对于所有其他路线都工作得非常好。当我打开检查元素时,元标记也会更新。我添加了一些配置,以便不在 firebase.json How to Prevent caching for the index.html of an SPA上缓存 html 文件,并将 server.ts 文件中的“cache”值设置为“No-cache”,如下所示
app.get('*', (req, res) => {
res.set('Cache-Control', 'public, max-age=0, s-maxage=0, no-cache');
res.render('index', { req });
});
Run Code Online (Sandbox Code Playgroud)
但对我来说没有任何作用。请帮忙。
firebase-hosting google-cloud-functions angular-universal angular angular8