简体   繁体   中英

How to clear Amazon CloudFront Cache completely?

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:

在此处输入图片说明

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

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

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.

根据AWS文档,您需要使用/ *代替/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM