【发布时间】:2015-07-21 04:15:59
【问题描述】:
我使用我在 S3 上的文件在云端创建了一个发行版。 它工作正常,我的所有文件都可用。但是今天我在 S3 上更新了我的文件并尝试通过 Cloudfront 访问它们,但它仍然给出了旧文件。
我错过了什么?
【问题讨论】:
-
旧文件可能仍会缓存在 Cloudfront 中,具体取决于它们的到期标头。您希望 Cloudfront 将它们缓存多长时间?
-
缓存缓存文件。 The length of time is configurable.
-
对于现在遇到这种情况的人,您必须使
/无效,而不是index.html。如果你做index.html,它只会在有人去example.com/index.html时才有效。既然你想让它在example.com上工作,/会给你你想要的。
标签: amazon-web-services amazon-s3 amazon-cloudfront