首页 > 解决方案 > 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. This is happening only for PDF file type. 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.

Thanks

标签: cachingcdnazure-cdn

解决方案


雷,

您可以使用以下 Rest API 文档从 Azure CDN 中清除内容: https ://docs.microsoft.com/en-us/rest/api/cdn/cdn/endpoints/purgecontent

在请求正文中,在 contentPaths 参数下,您可以提供要清除的内容的路径。它可以描述文件路径或通配符目录。

谢谢!


推荐阅读