How to clear Amazon CloudFront Cache completely?

22,687

Solution 1

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

Solution 2

You need to use /* instead of /.

Also, if you need to do this frequently, you can do it using the AWS CLI.

aws cloudfront create-invalidation --distribution-id=YOUR_DISTRIBUTION_ID --paths "/*"

Edit: thanks to @speckledcarp, you need to use "/*" (with quotes) when using the CLI.

Share:
22,687
codersofthedark
Author by

codersofthedark

ಠ_ಠ Security -- Stability -- Scalibility

Updated on November 26, 2020

Comments

  • codersofthedark
    codersofthedark over 3 years

    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?