简体   繁体   English

如何以编程方式清除项目的 CDN 缓存?

[英]How to purge CDN cache programmatically for an item?

After integration of azure CDN in our site, we found that the cache is not purged while replacing the file.在我们的站点中集成azure CDN后,我们发现替换文件时没有清除缓存。 This is happening only for PDF file type.这只发生在 PDF 文件类型。 We want to purge the cache on replace of the file.我们想在替换文件时清除缓存。 Please help us if anyone has faced the similar issue and purged the CDN cache programmatically.如果有人遇到类似问题并以编程方式清除 CDN 缓存,请帮助我们。

Thanks谢谢

S.Ray, S.雷,

You can use the below Rest API doc to purge content from Azure CDN: https://docs.microsoft.com/en-us/rest/api/cdn/cdn/endpoints/purgecontent You can use the below Rest API doc to purge content from Azure CDN: https://docs.microsoft.com/en-us/rest/api/cdn/cdn/endpoints/purgecontent

In the request body, under contentPaths parameter, you can provide the path to the content to be purged.在请求正文中,在 contentPaths 参数下,您可以提供要清除的内容的路径。 It can describe a file path or a wild card directory.它可以描述文件路径或通配符目录。

Thanks!谢谢!

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

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