Amazon CloudFront 失效 API [英] Amazon CloudFront invalidation API
问题描述
我们的应用程序中使用的图像是从 Amazon CloudFront 呈现的.
The images used in our application are rendered from Amazon CloudFront.
修改现有图像时,它不会立即反映图像更改,因为 CloudFront 需要大约 24 小时才能更新.
When an existing image is modified, it does not reflect the image change immediately since CloudFront take around 24 hours to update.
作为一种解决方法,我计划调用 CreateInvalidation 立即反映文件更改.
As a workaround, I'm planning to call CreateInvalidation to reflect the file change immediately.
是否可以在没有 SDK 的情况下使用此失效调用?
Is it possible to use this invalidation call without SDK?
使用 ColdFusion 编程语言并且似乎没有为此提供 SDK.
Using ColdFusion programming language and does not seem to have SDK for this.
推荐答案
使对象无效的一些替代方法是:
Some alternatives to invalidating an object are:
- 使用版本化对象名称更新现有对象,例如如
image_1.jpg
更改为image_2.jpg
- 根据查询字符串参数配置 CloudFront 进行缓存例如将 CloudFront 配置为将参数(例如
?version=1
)识别为文件名的一部分,因此您的应用程序可以使用?version=2
引用新版本,并且强制 CloudFront 将其视为不同的对象
- Updating Existing Objects Using Versioned Object Names, such as
image_1.jpg
changing toimage_2.jpg
- Configuring CloudFront to Cache Based on Query String Parameters such as configuring CloudFront to recognize parameters (eg
?version=1
) as part of the filename, therefore your app can reference a new version by using?version=2
and that forces CloudFront to treat it as a different object
这篇关于Amazon CloudFront 失效 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!