Saibalini Ray
Saibalini Ray

Reputation: 31

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

Upvotes: 2

Views: 669

Answers (1)

Gitarani Sharma
Gitarani Sharma

Reputation: 905

S.Ray ,

You can use the below Rest API doc to purge content from Azure CDN: https://learn.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. It can describe a file path or a wild card directory.

Thanks!

Upvotes: 3

Related Questions