Reputation: 1606
I have some xml files in the Azure blob storage. In a Web Unity App I need to download these files directly.
Like : http://myblobstorage.net/file.xml
Is there a way to disable cache because sometimes, the new file isn't used.
Is it possible to do that ? Maybe adding something in the request header ?
I saw another solution that consists to add a parameter at the end of the link, does it work ?
Like : http://myblobstorage.net/file.xml?nocache=randomnumber
Is it possible to save a file directly in the cache ? or in a temp folder ?
If you have any solution/suggestion !
Thanks a lot !
Upvotes: 0
Views: 1278
Reputation: 24895
Like you said, you can disable the cache by adding something random to the query string (DateTim.Now.Ticks for example). An other way to control the cache is by setting the CacheControl property on your blob:
//Create a blob
CloudBlob blob = new CloudBlob("newcontainer/ablob.text", blobClient);
blob.UploadText("this is a blob");
//Set CacheControl property
blob.Properties.CacheControl = "public, max-age=31536000" // nocache is also an option;
blob.SetProperties();
https://azure.microsoft.com/en-us/documentation/articles/storage-properties-metadata/
Upvotes: 1
Reputation: 1606
It's strange because when i add the cachecontrol property to no-cache, my xml file won't save. For now I will use the Tick at the end of the url.
Is it possible to save a file directly in the cache from asp.net ? or maybe access to the temp folder ?
Upvotes: 0