How to clear Amazon CloudFront Cache completely?

codersofthedark picture codersofthedark · Aug 13, 2014 · Viewed 19.8k times · Source

I made some changes to my origin server which now serves different data from same url.

I tried to clear my cache completely by doing the following invalidation in CF UI:

enter image description here

But this didn't work. How can I wipe off completely the Amazon CloudFront cache's in one go?

Answer

imperalix picture imperalix · Aug 13, 2014

CloudFront does now support wildcard or full distribution invalidation. You will need do do one of the followng.

  • Invalidate each object that has changed
  • Invalidate /*
  • Version your objects so that they are considered new (Ie rename or querystring)

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#invalidating-objects-console