简体   繁体   English

通过 gsutils 设置缓存控制元数据不会更新响应标头

[英]Setting Cache-Control metadata via gsutils does not update response headers

When setting the cache-control metadata key via the gsutils command:通过 gsutils 命令设置缓存控制元数据键时:

gsutil -m setmeta -h "Cache-Control:public, max-age=14400" 'gs://my-bucket/style.css'

I verify that the metadata is updated correctly using another gsutils command:我使用另一个 gsutils 命令验证元数据是否已正确更新:

gsutil stat 'gs://my-bucket/style.css'

However, when accessing this object via curl --head the value is not update但是,当通过curl --head访问此 object 时,值未更新

content-type: text/css
age: 232
cache-control: public,max-age=3600

I am expecting for the max-age of the cache-control property to be set to the value specified in the gsutil command which is 14400.我期望将 cache-control 属性的 max-age 设置为 gsutil 命令中指定的值,即 14400。

I was not using the correct cache-mode on the bucket, solution was in updating the cache-mode to USE_ORIGIN_HEADERS.我没有在存储桶上使用正确的缓存模式,解决方案是将缓存模式更新为 USE_ORIGIN_HEADERS。 Thank you!谢谢!

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

相关问题 Cloudfront 缓存控制标头丢失 - Cloudfront cache-control headers missing 如何在统一存储桶上设置 Cache-Control 元数据? - How do I set Cache-Control metadata on a uniform bucket? 如何使用 CLI 删除 S3 中的 Cache-Control 元数据? - How can I remove Cache-Control metadata in S3 using the CLI? 如何在亚马逊云端设置 Cache-Control Header? - How to set Cache-Control Header in amazon cloudfront? GCP云存储在指定cache-control header后仍然缓存public object - GCP cloud storage still caches public object after specifying cache-control header 即使使用缓存控制,来自云端的 RefreshHit:max-age=0,无存储 - RefreshHit from cloudfront even with cache-control: max-age=0, no-store 如何使用 github s3 同步操作将缓存控制设置为 max-age=0 - How to set cache-control to max-age=0 with github s3 sync action 来自 AWS CloudFront 的外部 Next.js 图像的缓存控制策略对于 Google Lighthouse 效率不高 - Cache-Control policy for external Next.js Image coming from AWS CloudFront is not efficient for Google Lighthouse CORS 错误:预检响应中的 Access-Control-Allow-Headers 不允许请求 header 字段授权 - CORS error: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response 在 js 中设置 azure blob 的元数据 - Setting Metadata on azure blob in js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM