Cloudfront serving a different version of content from an S3 bucket

0

Hello, we updated some files related to a website in an s3 bucket such as index.html for example, the intention would be to update a tag on a social network, I noticed that through the url of the bucket itself the value was updated, however When accessing via the DNS configured on a Route53, I'm not getting the same result. I've already tried to invalidate the cache for CloudFront but I wasn't very successful.

I noticed that the other html files that I updated also had the same behavior, when accessing the s3 url I have the new version, otherwise I have a different version.

Carlos
已提问 1 个月前150 查看次数
2 回答
1

Hi,

Go to your CloudFront distribution in the AWS Management Console. Navigate to the "Invalidations" tab and create a new invalidation for the files you've updated (e.g., /index.html). This tells CloudFront to fetch fresh copies from the S3 bucket. After invalidating, wait for a few minutes for the changes to take effect. Sometimes it can take a bit of time for CloudFront to clear its cache. Make sure your S3 bucket is sending appropriate Cache-Control headers. You can set them to no-cache to ensure CloudFront always fetches the latest version. Check if the updated files are accessible directly from the S3 bucket URL. If they are, then the issue is likely with CloudFront caching.

please look at this link https://repost.aws/knowledge-center/cloudfront-serving-outdated-content-s3.

已回答 1 个月前
profile pictureAWS
专家
已审核 1 个月前
0

Hi

As I understand that you already invalidate the cache,

Even though you invalidated the cache, it might take some time (around 5 minutes) for the invalidation to propagate across all CloudFront edge locations.

Here is the link https://repost.aws/knowledge-center/cloudfront-serving-outdated-content-s3 to give you clear information about the solution

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/UpdatingExistingObjects.html#ReplacingObjects

How best to serve versioned S3 files from CloudFront

profile picture
专家
GK
已回答 1 个月前
profile pictureAWS
专家
已审核 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则