AppEngine随机提供旧文件。

huangapple go评论84阅读模式
英文:

appengine randomly serves old files

问题

我目前正在使用Google Appengine来托管一个以Golang作为后端的网站。我已经设置了自定义域名,有时它能正常工作。我的网站需要从服务器获取一些CSS和JS文件。过去这些文件都能正常提供,但现在它们会随机停止工作。无论是在"mydomain.de"还是"myapp.appspot.com"域名上都会出现这个问题。有时它在正常域名上工作,然后在另一个域名上工作,有时甚至两个域名都能正常工作。但如果我在几分钟后重新加载网站,它只会显示一个旧的index.html文件(我几天前已经删除了该文件)。

有人在过去遇到过这个问题吗?有人知道如何解决吗?

提前感谢。

英文:

I'm currently using Google Appengine to host a website with Golang as the backend. I have a custom domain setup and (sometimes) it works perfectly fine. My website requires some css and js files from the server. These were served perfectly in the past but now it randomly stops working. Both on the "mydomain.de" and on the "myapp.appspot.com" domains. Sometimes it works on the normal domain and then it works on the other and sometimes even on both. But if I reload the site after a couple of minutes it just shows me an old index.html file (that I have removed days ago).

Did someone experience this problem in the past and does anyone know a fix for this?

Thanks in advance.

答案1

得分: 2

你是否排除了浏览器缓存作为问题的来源?如果在获取到旧版本后,使用Shift+刷新(假设使用Chrome或Firefox)可以显示所需的版本,那么请查看如何对CSS和JS进行“缓存破坏”,并检查app.yaml文档以了解如何设置静态资源的过期时间(假设你的index.html是静态的)。

英文:

Have you ruled out your browser cache as the source of the problem? If after getting a stale version, shift-reload (assuming Chrome or Firefox) brings up the desired version, then look into how to do "cache busting" for css and js, and check the app.yaml doc for how to set expiration times on static assets (assuming your index.html is static).

huangapple
  • 本文由 发表于 2017年3月14日 01:37:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/42769969.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定