Search code examples
amazon-web-servicesamazon-s3amazon-cloudfront

AWS CloudFront not updating with newer content


I've hosted a website on S3, with CloudFront over the top. Now I've changed some code and try to update the newer content but I'm unable to achieve it. I read somewhere that after invalidation it works but in my case even after invalidation I'm unable to update it. Could someone please tell me the exact steps to update the new content in CloudFront?


Solution

  • You need to be sure that you're using a wildcard character or explicitly invalidating the object you updated. After the invalidation completes, you need to do a hard reload of your webpage by pressing CTRL+F5 (Thanks Tom) or open the window in private browsing. This will ensure your local cache isn't the issue.

    CloudFront Invalidation Example

    Here's some documentation from AWS regarding invalidations. http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html