Amazon CloudFront 未在 S3 文件中显示更新的 headers
Amazon CloudFront not showing updated headers in S3 files
我正在使用 Amazon CloudFront 处理来自 Amazon S3 的文件。我最初并没有将 Amazon S3 元数据设置为发送 Cache-Control header,但我在几周前更改了它。大多数图像都显示了新 header。但是,我还有一些没有。
例如,如果我点击这个
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 header,并在我访问它时验证 header 已设置S3
https://s3.us-east-2.amazonaws.com/channelnet-useast-prod/Themes/Default/Images/phone-matttest.png
或云端
http://dfb8oqhjho7zs.cloudfront.net/Themes/Default/Images/phone-matttest.png
如何让 CloudFront 刷新这里正在发生的 Amazon-side 缓存?
您需要 clear/invalidate the CloudFront cache 以便它检查您的来源是否有更新。
我正在使用 Amazon CloudFront 处理来自 Amazon S3 的文件。我最初并没有将 Amazon S3 元数据设置为发送 Cache-Control header,但我在几周前更改了它。大多数图像都显示了新 header。但是,我还有一些没有。
例如,如果我点击这个 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 header,并在我访问它时验证 header 已设置S3 https://s3.us-east-2.amazonaws.com/channelnet-useast-prod/Themes/Default/Images/phone-matttest.png 或云端 http://dfb8oqhjho7zs.cloudfront.net/Themes/Default/Images/phone-matttest.png
如何让 CloudFront 刷新这里正在发生的 Amazon-side 缓存?
您需要 clear/invalidate the CloudFront cache 以便它检查您的来源是否有更新。