1
votes

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 :

enter image description here

enter image description here

What can I do?

1
Are you actually requesting index.html by name through CloudFront or just letting it be served implicitly, by going to the root of the site? If you aren't asking for it by name, then of course invalidating it by name would do nothing.Michael - sqlbot
all my requests are redirected to /index.html. It should be the same.Dougui

1 Answers

0
votes

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