AWS cloudfront not updating on update of files in S3

后端 未结 9 759
无人共我
无人共我 2021-02-01 14:12

I created a distribution in cloudfront using my files on S3. It worked fine and all my files were available. But today I updated my files on S3 and tried to access them via Clou

9条回答
  •  名媛妹妹
    2021-02-01 14:42

    Just ran into the same issue. At first I tried updating the cache control to be 0 and max-age=0 for the files in my S3 bucket I updated but that didn't work.

    What did work was following the steps from @jpaljasma. Here's the steps with some screen shots.

    First go to your AWS CloudFront service.

    Then click on the CloudFront distrubition you want to invalidate.

    Click on the invalidations tab then click on "Create Invalidation" which is circled in red.

    In the "object path" text field, you can list the specific files ie /index.html or just use the wildcard /* to invalidate all. This forces cloudfront to get the latest from everything in your S3 bucket.

    Once you filled in the text field click on "Invalidate", after CloudFront finishes invalidating you'll see your changes the next time you go to the web page.

提交回复
热议问题