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?
You can use invalidations to clear AWS S3 cache. To create invalidations login to AWS Console and go to Distribution Settings > Invalidations > Create Invalidation. Once invalidation is created just type path of file or a wildcard to purge the cache.
By default, CloudFront caches a response from Amazon S3 for 24 hours (Default TTL of 86,400 seconds). If your request lands at an edge location that served the Amazon S3 response within 24 hours, then CloudFront uses the cached response.
Right click your distribution. Select "Get Cloudfront invalidation list" Then select "Create" to create a new invalidation list. Select the files to invalidate, and click "Invalidate." Wait 5-15 minutes.
CloudFront does now support wildcard or full distribution invalidation. You will need do do one of the followng.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With