Michele Giglioni
Michele Giglioni

Reputation: 339

aws cloudfront does not replicate s3 bucket static website correctly after 48 hours

I hosted a static website on aws s3 and added cloudfront to route 53 linking it to the domain name. I noticed that an html change I implemented/uploaded on the s3 bucket code more than 48 hours ago is not shown on cloudfront yet (whereas the s3 endpoint obviously has shown it correctly since the change). Strangely enough, other html changes I just implemented/uploaded on s3 30 minutes ago are already correctly shown via cloudfront. Shouldn't cloudfront refresh itself every 24 hours to cache origin content? Just for reference the code snippet I am talking about is related to a menu navigation bar, to transform the menu in a drop-down-list once the display is restricted.

  <div class="mainmenu-area">
        <div class="container">
            <div class="row">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div> 

Is there anything I can do to have cloudfront replicate exactly the s3 content? So far I just waited for 24 hours, just wanted to avoid incurring the cache refreshing additional charges but now it scares me that more than 48 hours have gone by with no result. Thank you, wish you a good day,

Upvotes: 1

Views: 271

Answers (1)

Marcin
Marcin

Reputation: 238975

General strategies for updating CloudFront (CF) distro are listed in the AWS docs. If these basic strategies are not working, as seems to be the case for you, you can force CF to Invalidate Files.

However, please note that:

The first 1,000 invalidation paths that you submit per month are free; you pay for each invalidation path over 1,000 in a month.

Upvotes: 1

Related Questions