它说我们可以使用通配符
假设我们有这样的路径
https://cdn_url/rootimage/first/1/type/1.png
https://cdn_url/rootimage/first/1/type/2.png
https://cdn_url/rootimage/first/2/type/1.png
https://cdn_url/rootimage/first/2/type/2.png
https://cdn_url/rootimage/second/1/type/1.png
https://cdn_url/rootimage/second/1/type/2.png
https://cdn_url/rootimage/second/2/type/1.png
https://cdn_url/rootimage/second/1/type/2.png
所以如果我写
AmazonCloudFrontClient objClient = new AmazonCloudFrontClient(ConfigurationManager.AppSettings["s3accesskey"], ConfigurationManager.AppSettings["s3secret"]);
objClient.CreateInvalidation(new CreateInvalidationRequest
{
DistributionId = ConfigurationManager.AppSettings["CDNDistributionId"],
InvalidationBatch = new InvalidationBatch
{
Paths = new Paths { Items = "/cdn_url/rootimage/*", Quantity = 1 }
}
});
上面的代码可以工作吗? 那么“数量”是 1 还是所有实际图像的数量。
如何验证失效是否已完成。
我也在门户上手动尝试过,几分钟后我看到它说失效已完成,我如何确定图像是否已从 Edge 中删除。
谢谢
最佳答案
经过大量挖掘,看来,
可以使用图像标题响应
Connection
keep-alive Date
Mon, 15 Feb 2016 09:54:40 GMT Etag
"8239143f88d513feb78b025c5d4e1da7" Last-Modified
Fri, 12 Feb 2016 05:32:30 GMT Server
AmazonS3 Via 1.1 cldfrontUrl.ddfds (CloudFront) X-Amz-Cf-Id NKGtNTaLYGepIJ9Vjc1xgtQGn4AuhukYutQBDtSRPIyTGBDwLcxXgA== X-Cache Miss from cloudfront
如果是这样
Miss from cloudfront // Object is not in edge..
和
Hit from cloudfront //Object is in edge..
关于asp.net - AWS 对象失效 -/如何确定图像是否从 Edge 中删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35332759/