简体   繁体   English

Firebase:部署到主机后还是旧版本,怎么样?

[英]Firebase: Still old version after deploy to hosting, how?

I have received for maintenance a rather primitive react app hosted on firebase (developed by someone else).我收到了一个托管在 firebase(由其他人开发)上的相当原始的 React 应用程序以进行维护。 Now weird things are happening:现在奇怪的事情发生了:

  • I change content of a file (even simple text change)我更改文件的内容(即使是简单的文本更改)
  • Run deploy (hosting) - I see in firebase console that deploy was successful运行部署(托管)- 我在 firebase 控制台中看到部署成功
  • Still: page content is still old, without changes!仍然:页面内容仍然是旧的,没有变化!

How can it be?怎么会这样? I use Chrome incognito mode to ensure no cache on browser side, and Firebase docs say that deployment clear server cache.我使用 Chrome 隐身模式来确保浏览器端没有缓存,Firebase 文档说部署清除服务器缓存。

Turns out it is about cache setttings of firebase. I've seen people wrote default it is about one hour (sic.) so I overridden the cache header settings as referenced and now it is immediately visible after publishing.结果它是关于 firebase 的缓存设置。我看到人们写默认它是大约一小时(原文如此。)所以我覆盖了引用的缓存 header 设置,现在它在发布后立即可见。

https://firebase.google.com/docs/hosting/manage-cache https://firebase.google.com/docs/hosting/manage-cache

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM