如何更新Amazon的CDN(CloudFront)上的文件? [英] How can I update files on Amazon's CDN (CloudFront)?

查看:956
本文介绍了如何更新Amazon的CDN(CloudFront)上的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法更新存储在Amazon CloudFront上的文件(Amazon的CDN服务)?
似乎不会对我们所做的任何文件进行任何更新(例如,删除文件并使用与之前相同的文件名存储新文件)。
我必须明确地触发更新过程以从边缘服务器删除文件,以便发布新的文件内容吗?

Is there any way to update files stored on Amazon CloudFront (Amazon's CDN service)? Seems like it won't take any update of a file we make (e.g. removing the file and storing the new one with the same file name as before). Do I have to explicitly trigger an update process to remove the files from the edge servers to get the new file contents published?

感谢您的帮助

推荐答案

亚马逊添加了无效功能。 这是API参考

Amazon added an Invalidation Feature. This is API Reference.

API参考中的示例请求:

Sample Request from the API Reference:

POST /2010-08-01/distribution/[distribution ID]/invalidation HTTP/1.0
Host: cloudfront.amazonaws.com
Authorization: [AWS authentication string]
Content-Type: text/xml

<InvalidationBatch>
   <Path>/image1.jpg</Path>
   <Path>/image2.jpg</Path>
   <Path>/videos/movie.flv</Path>
   <CallerReference>my-batch</CallerReference>
</InvalidationBatch>

这篇关于如何更新Amazon的CDN(CloudFront)上的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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