Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
For clearing cache, we have used the below two lines of code...
When we call the clear-cache page, My server CPU utilization is going to 100% and automatically website is getting down.
Can anyone help me what is the wrong in my code, please?
Hi Suman,
I think this is pretty normal. When calling HttpRuntime.Close(); you actually tell your web application to shutdown.
HttpRuntime.Close();
See : https://docs.microsoft.com/en-us/dotnet/api/system.web.httpruntime.close?view=netframework-4.7.1#SystemWebHttpRuntime_Close
Why are you calling this ?
Dave
Hi Dave, Thank you for your reply.
I thought it will clear the cache for the current request.
I think removing this one will solve your issue.
Thank You Dave. I will try this and monitor the CPU Utilization.
Is that the only code on the entire clear cache page? If not, would you post more?
@Greg,
full code for clear cache...
@ string prefix = null; if (prefix == null) { prefix = ""; } prefix = prefix.ToLower(); List
System.Collections.IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Key.ToString().ToLower().StartsWith(prefix)) { itemsToRemove.Add(enumerator.Key.ToString()); } } foreach (string itemToRemove in itemsToRemove) { HttpContext.Current.Cache.Remove(itemToRemove); } HttpContext.Current.Cache.Remove("somestring"); HttpRuntime.Close();
}
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco Cache Problem (Server CPU Utilisation going to 100%)
For clearing cache, we have used the below two lines of code...
When we call the clear-cache page, My server CPU utilization is going to 100% and automatically website is getting down.
Can anyone help me what is the wrong in my code, please?
Hi Suman,
I think this is pretty normal. When calling
HttpRuntime.Close();
you actually tell your web application to shutdown.See : https://docs.microsoft.com/en-us/dotnet/api/system.web.httpruntime.close?view=netframework-4.7.1#SystemWebHttpRuntime_Close
Why are you calling this ?
Dave
Hi Dave, Thank you for your reply.
I thought it will clear the cache for the current request.
I think removing this one will solve your issue.
Dave
Thank You Dave. I will try this and monitor the CPU Utilization.
Is that the only code on the entire clear cache page? If not, would you post more?
@Greg,
full code for clear cache...
@ string prefix = null; if (prefix == null) { prefix = ""; } prefix = prefix.ToLower(); List
}
is working on a reply...