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

查看:47
本文介绍了如何更新 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?

感谢您的帮助

推荐答案

Amazon 添加了失效功能.这是 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天全站免登陆