简体   繁体   English

当我从 C# 的亚马逊 s3 存储桶中删除文件时,有没有办法使文件无效(CloudFront 缓存问题)?

[英]Is there a way to invalidate a file when I delete it from an amazon s3 bucket in C# (CloudFront cache issue)?

When I delete a file from amazon bucket through this:当我通过这个从亚马逊存储桶中删除一个文件时:

s3.DeleteObject(object);

Is there a way to invalidate it to prevent the CloudFront cache problem?有没有办法使其无效以防止 CloudFront 缓存问题?

This is a two step process.这是一个两步过程。 After deleting the object from S3, you will have to Invlidate the cache on CloudFront ( similar post ) using CreateInvalidationRequest() API call.从 S3 中删除 object 后,您将不得不使用 CreateInvalidationRequest() API 调用在 CloudFront( 类似的帖子)上进行缓存。 CF keeps an object cached for 24hrs by default. CF 默认将 object 缓存 24 小时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM