Amazon S3 到期日期? [英] Amazon S3 Expiration Date?

查看:91
本文介绍了Amazon S3 到期日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这个问题不是太简陋,但我很困惑...

I hope this question isn't too rudimentary, but I'm confused...

在我阅读的 S3 文档中:

In the S3 documentation I read:

所有 HTTP 查询都有一个过期时间允许您设置方式的参数只要查询有效.为了例如,您可以配置一个网页图形在很长时间后过期一段时间或软件下载仅持续 24 小时.

All HTTP queries have an expiration parameter that allows you to set how long the query will be valid. For example, you can configure a web page graphic to expire after a very long period of time or a software download to only last for 24 hours.

对于可公开访问的数据对象(文件),这是否意味着数据对象(文件)本身将不再有效,或者浏览器将在到期日期后简单地重新缓存该对象.例如,如果我将到期时间设置那么长,我会在十年后丢失我的数据吗?或者,如果我将下载设置为 24 小时,那么它会消失/无法访问吗?

For a publicly accessible data object (file), does this mean that the data object (file) itself will not be valid anymore, or that the browser will simply re-cache the object after the expiration date. As in, will I lose my data after ten years if I set my expirations that long? Or if I set a download for 24 hours, is it gone/inaccessible past that?

如果我不设置到期日期怎么办?

What if I don't set an expiration date?

推荐答案

我相信您指的是存储在 Amazon S3 上的私有数据的签名 URL.

I believe you are referring to the signed urls for private data stored on Amazon S3.

如果文件是可公开访问的,则可以通过文件的简单 URL 访问它们:

If files are publicly accessible they can be accessed with a simple url to the file:

例如 http://s3.amazonaws.com/[bucket]/[key]

但是,它们可以设置为private在这种情况下,您需要提供一个签名网址访问文件.这个 url 是使用你的公钥和私钥创建的,它的这个 url 有一个过期时间.例如

However, they can be set to private in which case you need to provide a signed url to access the file. This url is created using your public and secret keys, and its this url that has an expiry time. eg

http://[bucket].s3.amazonaws.com/[key]?AWSAccessKeyId=[AWS_Public_Key]&Expires=1294766482&Signature=[generated_hash]

根据您的问题,对于网络图形,您可能会重复使用相同生成的 url,并将到期时间设置为很远的将来,以便浏览器可以缓存文件,而对于文件下载,您可能会创建一个新的 url对于每个将 url 设置为仅提前一天到期的请求,以保护您的数据.

As per your question, for web graphics, you might re-use the same generated url with the expiry time set far into the future so that browsers can cache the file, whereas for file downloads you'd probably create a new url for each request with the url set to expire only a day in advance to protect your data.

不会过期/删除/移除您存储在 S3 上的数据.它只影响文件的 url,您可以根据需要生成任意数量的具有不同到期日期的 url.

This DOES NOT expire/delete/remove your data stored on S3. It only affects the url to the file and you can generate as many urls with different expiry dates as you require.

这篇关于Amazon S3 到期日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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