0

I use DNS of a Hosted Zone of Route 53 on a Godaddy domain.

Also, I create an AWS certificate, CloudFront distribution, and a S3 Bucket for my static website.

So I have my site with an SSL certificate working correctly.

The issue starts when I need to make a change on the site, it does not refresh the content on the domain name, but if I use bucket endpont: http://....s3-website-us-west-1.amazonaws.com it has the latest build.

How can I refresh data inside my custom domain name?

Jesus
  • 331
  • 1
  • 4
  • 19

1 Answers1

1

Because you are using CloudFront every time you change your website you should run an invalidation. To do that you will need to do the next:

  • Go to your CloudFront distribution cloudfront distribution

  • Then go to Invalidations invalidation option

  • Then click on "Create Invalidation" and add this "/*" enter image description here

  • And finally click on "Create Invalidation"

  • Then you should be able to see the changes on your browser, also try to clean your cache or see your website on a Private Tab

Derek Menénedez
  • 2,003
  • 11
  • 20
  • Awesome! this works, can you explain a bit more why we need to run CloudFront invalidation for people reading this question? – Jesus May 24 '22 at 03:39
  • 2
    @Jesus - the answer is complicated, but in simple terms, CloudFront is a cache and it is caching your objects. If you want immediate cache refresh, you must invalidate the existing cache. Your question does not state what type of objects, but for web static assets typically you would create a new object name for new versions ( the object name has a version number). This quickly solves cache issues. – John Hanley May 24 '22 at 06:12