简体   繁体   中英

Cloudfront doesn't clear cache

I have a cloudfront distribution that serve a s3 bucket. When I want to access to the "index.html" through the distribution, I have this header :

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

But when I access to the same page through S3, I have this :

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

As you can see, the last-modified date is not the same and cloudfront serve an old file. The pages are not the same, cloudfront serve and older one.

I created a new cache invalidation with a /index.html to be sure the cache is clean, the invalidation is done, but I have the result. I also cleared the cache of the browser.

Here is my origin and cache behavior :

在此处输入图片说明

在此处输入图片说明

What can I do?

您的配置看起来很干净,您应该尝试使用*来使所有文件无效

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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