Old S3 Content Being Served, Help!

0

A month ago, I decided to implement a cloudfront dirstribution for a static web hosting s3 bucket when setting up a CI/CD pipeline with Buddy. My domain is managed by route 53. When changing this, I made sure to change my A and AAAA records for my site, eckmantek.com, from their default to my distribution, which is d22tb0q1u7k32l.cloudfront.net. With this set up, I began using my pipeline, but when I now navigate to my domain, my old content is still being served. I dug around in icann and found different name servers for my domain than my distro, so maybe this is related?

I am still quite new, so apologies for the basicness of this question!

已提問 2 年前檢視次數 423 次
2 個答案
3

Hello, It appears that the objects in the cloudfront cache are not updating. There are two ways to clear the Cloudfront cache:

1- Work with a TTL (Timet to live) to decide how long an object will stay in the cloudfront cache until it expires and requires S3 the latest version of the object to be served. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html (See: Specifying the amount of time that CloudFront caches objects)

2- Directly invalidate the files in a specific path so that in the next request Cloudfront obtains the latest version of the file to S3. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html

I hope I have helped you and that you can solve the problem.

profile picture
專家
已回答 2 年前
AWS
專家
Hernito
已審閱 2 年前
0

I notice that different content is being served depending on whether you use the custom domain name, or the cloudfront domain name. This would indicate that you may not have associated the custom domain name with the correct/intended distribution in CloudFront, despite having updated DNS.

The following article may help you if you need to migrate the custom domain name between distributions and/or accounts: https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-migrate-account/

AWS
專家
Paul_L
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南