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 to see 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 the specific objects in your CloudFront distribution.

Steps to clear AWS CloudFront cache:

  1. Go to CloudFront dashboard in AWS Console.

  2. Click on the CloudFront distribution that you want to delete the cache of.
  3. Click on the Invalidations tab of the distribution.
  4. Click on the Create invalidation button.
  5. Enter the paths of the objects to be invalidated based on the given examples.

    Using /* for the path will clear all cache.

  6. Click on the Create invalidation button.
  7. Wait for the Cloudfront cache to be completely cleared.
Discuss the article:

Comment anonymously. Login not required.

Share!