Thoufeeq S L
Thoufeeq S L

Reputation: 159

What is the difference between normal browser caching and ASP cache object? How do they differ?

I am a beginner to ASP .Net caching concept

What is the difference between normal browser caching and ASP cache object? How do they differ?

Why do we need to have a cache in sever ? will it not cause a memory overhead in the sever?

Upvotes: 1

Views: 174

Answers (1)

Sameer Shah
Sameer Shah

Reputation: 1083

ASP .Net allows to cache an ASP .Net page's response in multiple ways. You can specify to cache that page in browser or in your application domain.

A normal browser caching or page caching refers to cache an object in the requesting browser's cache so that the next request for the same page can be served locally. A page can be cached in requesting browser, proxy server, application server or multiple of these. See this article to set cacheability of a page: http://msdn.microsoft.com/en-us/library/w9s3a17d(v=vs.100).aspx

Where as cache object in ASP .Net is created one per application domain. It is an in-memory cache that can be used to store sessions or for any other object caching purpose, like caching data loaded from database etc. Note that this is an in-memory cache (like a hashtable in a program), any data stored in this cache will be available to that application only.

Why do we need to have a cache in sever ? will it not cause a memory overhead in the sever?

Yes cache in server will cause memory overhead, but caching is always used to improve performance on cost of memory. For example instead of loading same data from a database on each request, data can be loaded in cache and all subsequent requests can be served from the cache, thus improving performance and reducing load on database server.

Apart from browser caching and in-memory caching, several out of process, distributed caching solutions like NCache are also available to boost performance of ASP .Net application and to overcome limitations in ASP.Net caching options. You can see further details here: http://www.alachisoft.com/ncache/asp-net-cache.html

I hope this helped :)

Upvotes: 2

Related Questions