- Newest
- Most votes
- Most comments
It is possible to delete the CloudFront cache using the method described in the following document.
https://repost.aws/knowledge-center/cloudfront-clear-cache
I also encountered this same issue and tried changing the cache-control max-age to 0 for an individual file that I changed, but Cloudfront still served up the old file. I followed @rePost-User-2827836 suggestion to delete all the files from S3 and re-upload the files from my computer, and Cloudfront was able to serve the updated site files.
Not sure, but perhaps just deleting the file I changed and uploading that particular file again to S3 would've worked.
I would like to know more about the mechanisms behind how Cloudfront pulls files from the s3 bucket (are old copies of files stored somewhere even when overwritten?) to cache on the edge network.
Found a post (see link below) which offers two solutions and also seems to explain what happened in my situation as well as the OP's situation (correct me if I'm wrong). I tried the first one--invalidating files which worked great for my situation (https://repost.aws/knowledge-center/cloudfront-serving-outdated-content-s3)
The procedure for invalidating files is explained in the following link: (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html)
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a day ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 months ago
Tried this, twice. Used /* to be sure to delete everything. No joy...
Just to be sure, delete your browser cache.
Ya, I had tried that as well - to no avail. What finally did help was deleting all the files from my s3 bucket (via the console) and then re-deploying my site. That got the latest version to serve. Further, upon deploying minor changes, they served as well. Obviously I lost the ability to fall back to earlier versions of the app that way, which is not cool, but at least I'm unstuck. Not sure what happened, but hope this gives insight to anyone else with similar issues.