If I delete all files in my Amazon s3 recycle bin, will it clear the cloud?

I serve all my static content from Cloudfront through my S3 bucket.

If I delete everything in my S3 bucket, will this clear the CloudFront cache? Or, since I set cache control in a very distant future, does CloudFront not even check anything in S3?

Is there an easy way to clear my entire CloudFront cache? I just found out about caching and, without hesitation, assigned ALL headers related to the cache for a year in the future. I know that I can change the file names in my HTML to get around this, and I can also invalidate the files one by one, but at the moment I have a large number of files and I will like the easy way to do this through the whiteboard.

+4
source share
3 answers

If you want to remove ALL content from your CloudFront distribution, the easiest way is to disable it, then completely remove the distribution, and then start with a new empty distribution.

You can disconnect and delete an existing distribution using the AWS console at https://console.aws.amazon.com/cloudfront/

If you have a large distribution and you want to remove SOME of the objects, then your best bet is the Object Invalidation mentioned by cloudberryman.

Enjoy it!

+4
source

If you want to force clear the CloudFront cache, you can use Object invalidation .

+1
source

You can create an invalidation by clicking the Distribution option of your CloudFront.

Enter OBJECT PATH / *

(It will clear CloudFront)

+1
source

Source: https://habr.com/ru/post/1383209/


All Articles