Clear AWS CloudFront cache

AWS CloudFront will cache your website's content on its edge locations based on the TTL values configured for your CloudFront distribution. Depending on your Object Caching configuration, there are chances that old content will be displayed to your website visitors for a period of time after you've updated your website's content. It could cause your visitors seeing outdated content at best, and at worst it could completely ruin your website's appearance and functionality if CSS and JavaScript files are involved.

You can remove AWS CloudFront's edge caches by invalidating your website's objects with these steps:

  1. Go to CloudFront dashboard in AWS Console.



  2. Click on the hyperlink in the ID column of the CloudFront distribution that you want to invalidate the cache of.
  3. Click on the Invalidations tab to go to the Invalidations options.
  4. Create an invalidation rule by clicking on Create invalidations button.

  5. Enter the paths of objects to be invalidated based on the given examples and click on the Invalidate button once completed.
  6. Status column will change from In Progress to Completed once invalidation process is completed.