亚马逊S3缓存控制所有桶 [英] Amazon S3 Cache-Control for all bucket

查看:519
本文介绍了亚马逊S3缓存控制所有桶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Amazon S3和CloudFront的。我有静态图像和用户下载的图像(每隔一小时+ 100图像)。

I use Amazon S3 and CloudFront. I have static images and users downloaded images(every hour + 100 images).

我需要设置的Cache-Control HTTP的所有斗头。

I need to set Cache-Control http header for all bucket.

我在谷歌搜索,但我不能找到任何指令,如何做到这一点。

I search in google, but I cant find any instruction, how to do this.

是的,我知道的元数据文件的属性,但我需要元数据的所有斗(在将来+新文件)。

Yes, I know about MetaData in file Properties, but I need MetaData for all bucket (+ new files in future).

如果这是不可能做到的亚马逊控制台,没有任何开放源代码解决方案?

If it is not possible to do in Amazon console, is there any open source solutions?

谢谢!

推荐答案

S3并没有一个机制,在现有或未来的对象设置全局桶的元数据。您的code需要设置这个创建对象时。

S3 does not have a mechanism for setting global bucket metadata on existing or future objects. Your code needs to set this when the objects are created.

您可以将其添加到使用放/复制的API,它可以让你的对象复制到自身,以修改元数据操作的对象,而无需实际下载并重新上传的对象。

You can add it to existing objects using the "put/copy" operation of the API, which allows you to copy an object onto itself, with modified metadata, without actually downloading and re-uploading the object.

http://docs.aws.amazon.com/AmazonS3/最新/ API / RESTObjectCOPY.html

关于开源解决方案,有可能是,但它们可以使用将是唯一可能的机制,以执行相同的操作 - 通过铲斗迭代和经由API更新每个对象的元数据。在任何情况下,虽然:

Regarding open-source solutions, there might be, but the only possible mechanism they could use would be to perform the same actions -- iterating through the bucket and updating each object's metadata via the API. In any event, though:

问题要求我们推荐或找书,工具,软件库,教程或其他异地资源是题外话堆栈溢出,因为他们往往​​以吸引自以为是的答案和垃圾邮件。

Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam.

— http://stackoverflow.com/help/on-topic

这篇关于亚马逊S3缓存控制所有桶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆