Set Google Storage Bucket's default cache control

前端 未结 6 1878
孤城傲影
孤城傲影 2021-01-11 16:41

Is there any way to set Bucket\'s default cache control (trying to override the public, max-age=3600 in bucket level every time creating a new object)

S

6条回答
  •  生来不讨喜
    2021-01-11 17:20

    If someone is still looking for an answer, one needs to set the metadata while adding the blob. For those who want to update the metadata for all existing objects in the bucket, you can use setmeta from gsutil - https://cloud.google.com/storage/docs/gsutil/commands/setmeta

    You just need to do the following :

    gsutil setmeta -r -h "Cache-control:public, max-age=12345" gs://bucket_name
    

提交回复
热议问题