AWS cloudfront does not update when updating files in S3

I created the distribution in the cloud using my files on S3. It worked perfectly and all my files were available. But today I updated my files on S3 and tried to access them through Cloudfront, but he still gave the old files.

What am I missing?

+14
source share
5 answers

You must invalidate your objects in the CloudFront distribution cache. In the old days, you had to do this one file at a time, now you can do it according to a pattern, for example / images / *

https://aws.amazon.com/about-aws/whats-new/2015/05/amazon-cloudfront-makes-it-easier-to-invalidate-multiple-objects/

+6
source

Cache-Control AWS S3:

  • , Cache-Control .
  • ( )
  • Properties
  • Metadata
  • Key Cache-Control, Add more metadata.
  • Key Cache-Control, Value max-age=0 ( 0 - , ). 0 , .

enter image description here

+4

tedder42 Chris Heald

, .. s3, , , 24 . , .

.

+1

, , .

Cache-Control: max-age = 0 no-cache?

Cache-Control 0 S3 This worked me

0

, ( , S3).

:

S3, . ( ) , CloudFront , . , , , ( ) . SPA, , , (index.html index2.html), CloudFront.

0

All Articles