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ヶ月前158ビュー
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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ