Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After update/delete files of Static Website in Azure it still shows the old

I have a Static Website in an Azure Blob Storage. I update my files by using the Release Pipelines in Azure DevOps.

I've been looking to the files by going in the portal and open the Editor(Preview), in there it shows that my files were updated well.

Now the problem is that when I go to this Static Website in the browser it does not update the content. So I tried to delete all my browser history/cache etc. Also this did nothing with the view when browsing to the Static Website.

I tried to delete all the files from the Static Website('Also delete blob snapshots' enabled), they were all deleted from the Static Website.

But also this did nothing when going to the Static Website in the browser.

So I did google if someone already got this problem, but without success. Also I tried to find if there was a button to restart the Static Website/Azure Blob Storage. But also without success.

I hope someone here can help me with this problem.


Extra info

  • Content is a build of a React App
  • I have made a custom domain so it could redirect to my own DNS

Bonus question:

Is there a way to delete files within the Azure Pipelines?

like image 731
MrLine Avatar asked Jul 29 '19 15:07

MrLine


1 Answers

If you can see updated files in azure storage, they are most likely updated. Something might be caching the files. You can check in chrome dev tools if the files are getting cached by browser.

Easiest way to auto update the cached files is adding a cache header such 'max-age' which forces the cache to be refreshed after an interval has passed.

Azure storage provides an option to set max-age header. For always getting data from storage and not using cache, set max-age to - 1

You can refer - https://learn.microsoft.com/en-us/azure/cdn/cdn-manage-expiration-of-blob-content#azure-storage-explorer for steps to do it

like image 108
Abbas Cyclewala Avatar answered Nov 02 '22 16:11

Abbas Cyclewala