简体   繁体   English

GCP云存储在指定cache-control header后仍然缓存public object

[英]GCP cloud storage still caches public object after specifying cache-control header

I am using the cloud storage REST api to upload the image to the bucket, which is public to allUsers.我正在使用云存储 REST api 将图像上传到对所有用户公开的存储桶。 When uploading a different image with the same object name it overwrites it on GCP, but the public link still displays the old object. I tried setting the Cache-Control header of the request to "no-store", but the problem still persisted.当上传具有相同 object 名称的不同图像时,它会在 GCP 上覆盖它,但公共链接仍然显示旧的 object。我尝试将请求的 Cache-Control header 设置为“no-store”,但问题仍然存在。 The metadata of the object (on the GCP UI) shows no field supplied in the Cache-Control. object 的元数据(在 GCP UI 上)显示 Cache-Control 中没有提供任何字段。 How can I force it to refresh the file at once?我怎样才能强制它立即刷新文件?

As per this cache directives for no - store A response with no-store isn't cached.根据此缓存指令no - store 不缓存带有 no-store 的响应。 This can be overridden on a per-backend basis with the FORCE_CACHE_ALL cache mode.这可以用 FORCE_CACHE_ALL 缓存模式在每个后端基础上覆盖。

By default, when the entire bucket is public, or the individual objects are public and the individual objects don't specify Cache-Control metadata, Cloud Storage assigns a Cache-Control: public, max-age=3600 header to the object. You can set different values by using Cache-Control metadata .默认情况下,当整个存储桶是公共的,或者单个对象是公共的并且单个对象没有指定 Cache-Control 元数据时,Cloud Storage 分配一个 Cache-Control: public, max-age=3600 header 到 object。你可以通过使用Cache-Control 元数据设置不同的值。 By setting the max age value less this may help you in resolving your issue.通过减少最大年龄值,这可能会帮助您解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cloudfront 缓存控制标头丢失 - Cloudfront cache-control headers missing 关于在触发 GCP 云时根据对象前缀过滤 GCP 云存储事件通知的建议 Function? - Advice on filtering GCP Cloud Storage event notifications, based on an object's prefix, when triggering a GCP Cloud Function? 谷歌云存储总是返回缓存控制私有 - Google Cloud Storage always returning cache control private 从图像的公共 URL 获取 Google Cloud Storage 对象 - Get Google Cloud Storage object from Public URL of an image gcp 云函数访问 gcp 存储桶是否有成本 - Is there a cost for gcp cloud functions to access gcp storage buckets 云存储 - AngularJS 视图的请求资源上不存在“访问控制允许来源”header - Cloud Storage - No 'Access-Control-Allow-Origin' header is present on the requested resource for AngularJS view Google Cloud Storage:请求的资源上不存在“Access-Control-Allow-Origin”header - Google Cloud Storage: No 'Access-Control-Allow-Origin' header is present on the requested resource 上传object到google云存储后获取响应码 - Get response code after uploading object to google cloud storage 来自 AWS CloudFront 的外部 Next.js 图像的缓存控制策略对于 Google Lighthouse 效率不高 - Cache-Control policy for external Next.js Image coming from AWS CloudFront is not efficient for Google Lighthouse 如何将日志从 fluentd(日志收集器)重定向到 GCP 云存储 - How to redirect logs from fluentd (log collector) to GCP Cloud Storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM