Cloudfront不会清除缓存

时间:2016-09-22 00:00:27

标签: caching amazon-s3 amazon-cloudfront

我有一个服务于s3存储桶的cloudfront发行版。当我想通过发行版访问“index.html”时,我有这个标题:

Age:72145
Cache-Control:max-age=63072000, public
Connection:keep-alive
Content-Length:3277
Content-Type:text/html; charset=utf-8
Date:Wed, 21 Sep 2016 03:44:37 GMT
Expires:Tue, 01 Jan 2030 00:00:00 GMT
Last-Modified:Tue, 20 Sep 2016 22:33:21 GMT
Server:AmazonS3
Vary:Accept-Encoding
Via:1.1 34a21b71f4db55f8628d1bae91bf1c7d.cloudfront.net (CloudFront)
X-Amz-Cf-Id:lZ4Zvrv7ZnpzONcKSkoayDxIPycYdi4Up7dR_XswDK-NNyM76Fipzw==
X-Cache:Hit from cloudfront
X-Con-Reuse:1

但是当我通过S3访问同一页面时,我有这个:

Accept-Ranges:bytes
Cache-Control:max-age=63072000, public
Content-Length:3253
Content-Type:text/html; charset=utf-8
Date:Wed, 21 Sep 2016 23:47:40 GMT
ETag:"13a78a9eb72912500ff63118d261eb47"
Expires:Tue, 01 Jan 2030 00:00:00 GMT
Last-Modified:Wed, 21 Sep 2016 22:59:40 GMT
Server:AmazonS3
x-amz-id-2:6fyAoGni4E4gZkic8t59EDfzxp2dQX9QX0Av/qlqA9P3R1sQE6zx+JhzBWOfM9zULpK0gK6lSRc=
x-amz-request-id:EB7F363ACED12957

如您所见,上次修改日期不同,cloudfront服务于旧文件。这些页面不同,云端服务和旧版本。

我使用/index.html创建了一个新的缓存失效,以确保缓存是干净的,失效已完成,但我有结果。我还清除了浏览器的缓存。

这是我的起源和缓存行为:

enter image description here

enter image description here

我该怎么办?

1 个答案:

答案 0 :(得分:0)

Your config looks clean, you should try to invalidate all the files with *