How to clear Amazon CloudFront Cache completely?

后端 未结 3 2005
粉色の甜心
粉色の甜心 2021-01-07 19:54

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

相关标签:
3条回答
  • 2021-01-07 20:05

    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

    0 讨论(0)
  • 2021-01-07 20:12

    According to AWS documentation you need to use /* instead of /

    0 讨论(0)
  • 2021-01-07 20:13

    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.

    0 讨论(0)
提交回复
热议问题