How can I update files on Amazon's CDN (CloudFront)?

后端 未结 9 653
情书的邮戳
情书的邮戳 2020-12-30 05:29

Is there any way to update files stored on Amazon CloudFront (Amazon\'s CDN service)? Seems like it won\'t take any update of a file we make (e.g. removing the file and stor

9条回答
  •  星月不相逢
    2020-12-30 05:39

    I seem to remember seeing this on serverfault already, but here's the answer:

    By "Amazon CDN" I assume you mean "CloudFront"?

    It's cached, so if you need it to be updated right now (as opposed to "new version will be visible in 24hours") you'll have to choose a new name. Instead of "logo.png", use "logo.png--0", and then update it using "logo.png--1", and change your html to point to that.

    There is no way to "flush" amazon cloudfront.

    Edit: This was not possible, it is now. See comments to this reply.

提交回复
热议问题