【问题标题】:Amazon CloudFront not showing updated headers in S3 filesAmazon CloudFront 未在 S3 文件中显示更新的标头
【发布时间】:2018-04-15 12:44:21
【问题描述】:

我将 Amazon CloudFront 与来自 Amazon S3 的文件一起使用。我最初并没有将 Amazon S3 元数据设置为发送 Cache-Control 标头,但我在几周前对其进行了更改。大多数图像都显示新标题。但是,我有一些仍然没有。

例如,如果我点击这个 https://s3.us-east-2.amazonaws.com/channelnet-useast-prod/Themes/Default/Images/phone.png,我明白了

Cache-Control:max-age=86400

但是,如果我转到指向该 S3 图像的 CloudFront URL http://dfb8oqhjho7zs.cloudfront.net/Themes/Default/Images/phone.png,我没有。

作为测试,我复制了一张图片,上传到 S3,设置了 Cache-Control 标头,当我通过 S3 访问它时验证了标头是否已设置 https://s3.us-east-2.amazonaws.com/channelnet-useast-prod/Themes/Default/Images/phone-matttest.png 或 CloudFront http://dfb8oqhjho7zs.cloudfront.net/Themes/Default/Images/phone-matttest.png

如何让 CloudFront 刷新此处正在进行的任何 Amazon 端缓存?

【问题讨论】:

    标签: amazon-web-services amazon-s3 amazon-cloudfront


    【解决方案1】:

    您需要clear/invalidate the CloudFront cache,以便它检查您的来源以获取更新。

    【讨论】:

    • 那行得通。我去了 CloudFront Distributions->Invalidations->Create Invalidation,输入 * 并单击无效。 i.stack.imgur.com/Mp5ji.png
    猜你喜欢
    • 1970-01-01
    • 2015-07-21
    • 2014-08-22
    • 2015-06-04
    • 2014-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-12
    相关资源
    最近更新 更多