部署时不更新CSS文件(Google AppEngine) [英] CSS File Not Updating on Deploy (Google AppEngine)

查看:78
本文介绍了部署时不更新CSS文件(Google AppEngine)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我推出了一个新版本的网站,但现在CSS和静态图片没有正确部署。

I pushed a new version of my website, but now the CSS and static images are not deploying properly.

这是搞砸了的页面: http://www.gaiagps.com

Appengine展示最新版本尽管如此: http://1.latest.gaiagps.appspot.com/

Appengine shows the latest version as being correct though: http://1.latest.gaiagps.appspot.com/

任何帮助?

推荐答案

引擎,即使使用缓存清除查询参数,如 /stylesheets/default.css?{{App.Version}}

I've seen this before on App Engine, even when using cache-busting query parameters like /stylesheets/default.css?{{ App.Version }}.

以下是我的(未经证实的)理论:

Here's my (unconfirmed) theory:


  1. 通过部署或更改新版本推送新版本至默认

  2. 虽然此更新正在传播到运行您的应用程序的所有GAE实例...

  3. 。 ..有人击中你的网站。

  4. 请求静态资源 default.c ss {{App.Version}} 被发送到Google的CDN,该CDN尚未拥有它。
  5. Google的CDN在传播之前向资源请求GAE步骤#2完成所有实例。

  6. 如果您不幸,GAE会从运行旧版本的实例提供资源...

  7. ...现在在Google的CDN中被缓存为权威的新版本。

  1. You push a new version by deploying or changing a new version to default.
  2. While this update is being propagated to all GAE instances running your app...
  3. ...someone hits your site.
  4. The request for static resource default.css{{ App.Version }} is sent to Google's CDN, which doesn't yet have it.
  5. Google's CDN asks GAE for the resource before propagation from step #2 is done for all instances.
  6. If you're unlucky, GAE serves up the resource from an instance running the old version...
  7. ...which now gets cached in Google's CDN as the authoritative "new" version.

当这(如果这是发生)发生,我可以确认没有任何缓存破坏浏览器工作将会有所帮助。 Google CDN服务器的版本不正确。

When this (if this is what happens) happens, I can confirm that no amount of cache-busting browser work will help. The Google CDN servers are holding the wrong version.

解决方法:我发现解决此问题的唯一方法是部署另一个版本。您不会再次冒险发生这种情况(如果自竞赛条件以来您未做任何CSS更改),因为即使竞争情况发生,大概您的第一次更新是在部署第二次更新时完成的,所以所有实例无论如何都会提供正确的版本。

To fix: The only way I've found to fix this is to deploy another version. You don't run the risk of this happening again (if you haven't made any CSS changes since the race condition), because even if the race condition occurs, presumably your first update is done by the time you deploy your second one, so all instances will be serving the correct version no matter what.

这篇关于部署时不更新CSS文件(Google AppEngine)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆