Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
821 views
in Technique[技术] by (71.8m points)

amazon-web-services - 通过CNAME别名访问应用时,会导致应用过时的原因是什么?(What could cause an app to be stale when accessing it through CNAME alias?)

I have a very strange situation where a stale version of my app is being served only when accessing it through its CNAME alias.

(我遇到一个非常奇怪的情况,仅当通过其CNAME别名访问它的应用程序时,才提供过时的版本。)

The app is a static node app built with Webpack and hosted on Zeit NOW.

(该应用程序是使用Webpack构建的静态节点应用程序,并托管在Zeit NOW上。)

If I access it using the direct Zeit URL, I get the most recent version and correct JS assets:

(如果我使用直接Zeit URL访问它,则会得到最新版本并更正JS资产:)

https://nates-app.now.sh/index.html -> https://nates-app.now.sh/client/index.eb53e753.js (current)

In AWS Route53, I have a CNAME set up to alias www.nates-app.com to https://nates-app.now.sh .

(在AWS Route53中,我将CNAME设置为别名www.nates-app.comhttps://nates-app.now.sh 。)

However, pointing my browser to https://www.nates-app.com results in a stale index.html .

(但是,将我的浏览器指向https://www.nates-app.com导致过时的index.html 。)

What's even stranger, is that the stale index.html page reqeusts stale JS and CSS assets, which also are being returned successfully:

(更奇怪的是,过时的index.html页面需要过时的JS和CSS资产,这些资产也已成功返回:)

https://www.nates-app.com/index.html -> https://www.nates-app.com/client/index.f64812dd.js (stale)

The stale version is more than 48 hours old.

(过时的版本已超过48小时。)

Dig shows nearly identical results.

(Dig显示几乎相同的结果。)

dig nates-app.now.sh results in the following ANSWER section:

(dig nates-app.now.sh结果显示在以下ANSWER部分中:)

;; ANSWER SECTION:
nates-app.now.sh.   60  IN  A   1.2.3.4
nates-app.now.sh.   60  IN  A   4.3.2.1

dig www.nates-app.com results in identical output, with only the one (expected) addition showing the CNAME in the ANSWER section:

(dig www.nates-app.com输出相同,只有一个(预期的)加法在ANSWER部分显示CNAME:)

;; ANSWER SECTION:
www.nates-app.com.  300 IN  CNAME   https://nates-app.now.sh.
nates-app.now.sh.   60  IN  A   1.2.3.4
nates-app.now.sh.   60  IN  A   4.3.2.1

I'm not using AWS Cloudfront, or any other CDN for static assets.

(我没有将AWS Cloudfront或任何其他CDN用于静态资产。)

I've obviously cleared my browser's cache, and even toggled my VPN off and on.

(我显然已经清除了浏览器的缓存,甚至关闭了我的VPN的电源。)

A colleague sees the same thing when accessing the internet from a different ISP.

(同事从其他ISP访问Internet时也会看到相同的事情。)

So what in the world wide web could be caching a (very) old version of my site's HTML and accompanying assets?

(那么,在互联网上什么可以缓存(非常旧版本的)网站的HTML和相关资源?)

  ask by Nate Vaughan translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Very weird, When I have experienced similar issue like this, the solution was always refreshing the browser cache or using an incognito mode.

(非常奇怪,当我遇到类似的问题时,解决方案始终是刷新浏览器缓存或使用隐身模式。)

Do you still experience the same

(你仍然经历同样的)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...