2

I have a file uploaded to my azure storage, and now I have replaced it with another version of this file. The old file size was 22 mb. now the new version is about 10 mb. After replace when I try to download the file with my custom domain it still downloads the old file(22 mb). But when I try to download with it's original url(storageName.blob.core.windows.net) I get the correct file.

I have tried to set cache-control header 1 minutes using Microsoft azure storage explorer.

max-age=1

But it didn't help.

Why is such kind of behavior? And how to solve this problem?

Karen Avdalyan
  • 382
  • 1
  • 20
  • Can you try to Purge by providing the specific URI? – msrini-MSIT May 27 '19 at 20:29
  • If be honest I don't know what Purge means, How can I do that or read from? Can I do that with azure storage explorer? – Karen Avdalyan May 29 '19 at 12:45
  • 2
    When you navigate to the Azure CDN profile, you can see a button on the top. Purge actually flushes the cached data in the CDN. – msrini-MSIT May 29 '19 at 13:08
  • But how azure caching behaves when updating existing data, I delete the file and upload the new file with the same name using storage explorer, and when I download the file with the custom domain url it downloads the old file.Why? Where can I read about it? – Karen Avdalyan May 29 '19 at 13:31

1 Answers1

3

When you have a CDN configured with Azure Storage and you updated the file in Storage, CDN will still serve the cached old file until the TTL expires.

So you should either do a Purge or you need to configure the caching rules to get desired rules.

You can read more about Caching rules in CDN here.

msrini-MSIT
  • 1,444
  • 1
  • 7
  • 11
  • https://learn.microsoft.com/en-us/azure/cdn/cdn-purge-endpoint Here it is described how to purge endpoint, but as I understand it clears the whole chace, is it possible purge only one file? I wander am I doing anything wrong, because replacing a file is a very common. How can I have the updated file after the replace? what is the best practice I think it is not normal to purge endpoint after every file change – Karen Avdalyan May 29 '19 at 13:58
  • Yeah, you can specify the path which you want to purge. By doing that only that path will be Purged. – msrini-MSIT May 29 '19 at 14:36