Sachin Kalia
Sachin Kalia

Reputation: 1107

Azure CDN content takes time to refresh

I'm using Azure CLI to purge the contents from Azure CDN endpoint. I got a reference from Microsoft Docs: https://learn.microsoft.com/en-us/cli/azure/cdn/endpoint?view=azure-cli-latest

https://learn.microsoft.com/en-us/azure/cdn/cdn-purge-endpoint

I use the following command to refresh specific png file as shown below:

az cdn endpoint purge -g cdnRG --profile-name cdnprofile2 --content-paths "/img/cdn.png" --name cdnprofileendpoint2

Command executed successfully, though surprised that content is not refreshing or sometime it takes time. is it the acceptable pattern? Kindly advise.

Upvotes: 1

Views: 5715

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28224

Since purging an Azure CDN endpoint only clears the cached content on the CDN edge servers. Any downstream caches, such as proxy servers and local browser caches, may still hold a cached copy of the file. You can force a downstream client to request the latest version of your file by giving it a unique name every time you update it, or by taking advantage of query string caching.

I suggest purging the same path contents in the Azure portal comparing to purge it with Azure CLI command. You also try to purge CDN endpoint with Azure Powershell.

The important thing is that the CDN provider takes influence on the purging time.

Purge requests take approximately 10 minutes to process with Azure CDN from Microsoft, approximately 2 minutes with Azure CDN from Verizon (standard and premium), and approximately 10 seconds with Azure CDN from Akamai. Azure CDN has a limit of 50 concurrent purge requests at any given time at the profile level.

Upvotes: 3

Related Questions