谷歌存储:bucket刚刚开始缓存文件。我该怎么做才能阻止它?

2024-09-29 02:16:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我不需要为已经上传的文件和将在未来上传的文件缓存

对于已上载的文件,我尝试使用gsutil setmeta,但仍在缓存文件

对于将来要上传的文件,我没有在python代码中做任何更改

Python代码

from google.cloud import storage

from google.cloud.storage import Blob

client = storage.Client()

bucket = client.get_bucket('my_bucket')

name = "vtt_files/test.txt"

blob = storage.Blob(name, bucket)

blob.upload_from_string("test213")

如果我输入http://storage.googleapis.com/my_bucket/vtt_files/test.txt, 文件被缓存

我该怎么办?事先非常感谢


Tags: 文件代码namefromtestimportclientcloud