Benjamin Gruenbaum
Benjamin Gruenbaum

Reputation: 276306

Refresh WebApp Instance Cache

We have an Azure WebApp with WEBSITE_LOCAL_CACHE_OPTION = Always set in order to reduce static file latency.

We have made a file change there and would like to force the instances to reload the cache.

How do I force a file cache refresh?

Upvotes: 3

Views: 9850

Answers (2)

Bouam K
Bouam K

Reputation: 463

I know it's an old subject, but maybe it will be helpfull for someone : If you are using C# you can add a button inside your application to remove the cache :

IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator();
while (enumerator.MoveNext())
{
HttpContext.Current.Cache.Remove((string)enumerator.Key);
}

Upvotes: 0

Peter
Peter

Reputation: 27944

The only way to refresh the cache is to restart the website.

Azure Web apps WEBSITE_LOCAL_CACHE_OPTION=Always requires stop and start of the site

Upvotes: 2

Related Questions