带有Cloudfront / CDN的预签名S3 URL [英] Pre-Signed S3 URLs with Cloudfront/CDN

查看:258
本文介绍了带有Cloudfront / CDN的预签名S3 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以生成CDN的预签名URL(即CloudFront?),还是可以将预签名URL参数附加到CloudFront URL上以代替使用?

Is it possible to generate pre-signed URLs for CDNs (i.e., CloudFront?), or can I append pre-signed URL parameters to a CloudFront URL to use instead?

示例:

string url = amazonS3Client.generatePresignedUrl(generatePresignedUrlRequest);

返回:

url = "https://bucket-name.s3.amazonaws.com/file.txt?AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXX&Expires=1111111111&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

我可以使用URL参数并附加到相应的CloudFront URL:

Can I take the URL parameters and append to corresponding CloudFront URL:

https://00000000000000.cloudfront.net/file.txt?AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXX&Expires=1111111111&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

这项工作可以允许下载文件吗?

Will this work to allow download of the file?

推荐答案

仅供参考优化而不是边缘缓存,您还可以考虑使用 Amazon S3 Transfer Acceleration: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html

FYI if you only want the network optimization, and not the edge caching, you can also consider using "Amazon S3 Transfer Acceleration": https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html

哟u继续使用S3签名,而不必实施Cloudfront签名。

This allows you to keep using S3 signatures, rather than having to implement Cloudfront signatures.

在此处查看我的答案以获取更多详细信息:https://stackoverflow.com/a/54139603/8046487

See my answer here for more details: https://stackoverflow.com/a/54139603/8046487

这篇关于带有Cloudfront / CDN的预签名S3 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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