I am trying to remove the cache from my CloudFront, but I am going crazy with this.
What I did so far:
Min TTL: 1 sec
.max-age=1
But still, if I update my S3 bucket, my Cloudfront is showing files that I already changed.
Can you guys point me on how to do it the right way? If there is a way to just clean cache when I want, even better, I just want to upload my files, see if CloudFront is showing the correct thing on Web, then I don't care anymore about the cache.
Thank you!
To display CloudFront cache statisticsSign in to the AWS Management Console and open the CloudFront console at https://console.aws.amazon.com/cloudfront/v3/home . In the navigation pane, click Cache Statistics.
Regional edge caches are CloudFront locations that are deployed globally, close to your viewers. They're located between your origin server and the POPs—global edge locations that serve content directly to viewers.
CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify.
You can use invalidation which is described in the documentation.
Recently this functionality was updated to allow to invalidate many objects at once. You can specify a path prefix and use : * to clear all cached objects.
However before deciding to use invalidations, please consider using versioned objects. There are many benefits to them described in the article referenced above.
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