Posts

Showing posts with the label Cache

Clear all cache in ASP.NET

The previous post was about advantage using cache in web application .Complex application must using cache to increase the performance of application. But sometime you a over heating the memory if so many information stored in cache and the cleaner(GC) need to clean up the mess. Unfortunately Garbage Collector(GC) not remove the cache, you need to do it by your self. The problem is how to get all key of the cache and then remove it.? So the solution is you need to use the IDictionaryEnumerator to get all of the cache key. Lets look at the method example. Feel free to try by your self. Clear Cache Method  public void clearCache()         {             IDictionaryEnumerator dictionaryEnumerators = Cache.GetEnumerator();             if (dictionaryEnumerators.MoveNext())             {                 Cache.Remove(dictionaryEnumerators.Key.ToString());                 clearCache();             }                     } By Mohd Zulkamal NOTE : – If You have Found this post Helpful, I will app

Improve load page performance by setting Browser Cache for Static Content - ASP.NET

Image
Files that the browser retrieves from the server should be stored in the browser’s cache as long as possible to help minimize server round-trips. If a page and all the resources it requires are in the browser’s cache, no server round-trips at all are required; the browser can render the page using only the cached content. Since that presents no load on the network or the server, it is obviously very good for scalability. Caching Static Content Every object stored in the browser cache includes an expiration time, beyond which the browser considers the content stale or invalid. You can manage those expiration times with the Cache-Control: max-age HTTP header. The Expires header performed the same function with HTTP 1.0, but Cache-Control overrides Expires when both are present. I prefer to use only Cache-Control when possible, thereby avoiding the confusion that might arise when you have two headers that specify the same thing. If you set neither the Expires nor Cache-Control: max-age HT

Caching in ASP.NET advantage and example

Caching in ASP.NET Today i want to discuss, how to improve web performance in asp.net. One of the approach are using Caching in asp.net application. The caching is a must in a Web application right now. This is because the caching will fasten access data directly from memory(RAM) rather than access in Hard Disk. This are advantage of using Caching in Web Application Advantage : Reduce round-trips: Content cached at the client or in proxies can eliminate web server round-trips. Content cached at the web server can eliminate database round-trips. Move content closer to clients: The farther away from clients content is located, the longer it takes to retrieve that content. Avoid time-consuming processes of regenerating reusable content: For content that takes a lot of time or resources to generate, system performance and scalability are improved if you can generate content once and then reuse it many times. Optimize state management: Caching state information at the client is more scalabl