mhenry1384
mhenry1384

Reputation: 7688

Amazon CloudFront not showing updated headers in S3 files

I am using Amazon CloudFront with the files coming from Amazon S3. I wasn't originally setting the Amazon S3 Metadata to send a Cache-Control header, but I changed it a few weeks ago. Most of the images are showing with the new header. However, I have some that still do not.

For example if I hit this https://s3.us-east-2.amazonaws.com/channelnet-useast-prod/Themes/Default/Images/phone.png, I see

Cache-Control:max-age=86400

But if I go to the CloudFront URL that points to that S3 image http://dfb8oqhjho7zs.cloudfront.net/Themes/Default/Images/phone.png, I do not.

As a test, I made a copy of the image, uploaded it to S3, set the Cache-Control header, and verified the header is set when I access it via S3 https://s3.us-east-2.amazonaws.com/channelnet-useast-prod/Themes/Default/Images/phone-matttest.png or CloudFront http://dfb8oqhjho7zs.cloudfront.net/Themes/Default/Images/phone-matttest.png

How do I get CloudFront to refresh whatever Amazon-side caching is going on here?

Upvotes: 1

Views: 1851

Answers (1)

Mark B
Mark B

Reputation: 201088

You need to clear/invalidate the CloudFront cache so that it will check your origin for updates.

Upvotes: 4

Related Questions