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 Answers
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
EXPERT
answered 2 years ago
AWS
EXPERT
Hernito
reviewed 2 years ago
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
EXPERT
Paul_L
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions