Posted: 7/1/2010
Hello Experts,
I am a learner.I am learning Caching in ASP.NET.There are three types of caching in ASP.NET.
1.Page output caching.
2.Partial Output caching.
3.Data Caching.
In Page output caching, all the rendered content of the page saved in Cache and page every time re-execute.
In Partial Output caching, we can apply caching rules on different parts of pages.
But Data Caching, I didn't understand.
Could anyone please explain me Data Caching?
Thanx in advance.
mohit said: Hello Experts,I am a learner.I am learning Caching in ASP.NET.There are three types of caching in ASP.NET.1.Page output caching.2.Partial Output caching.3.Data Caching.In Page output caching, all the rendered content of the page saved in Cache and page every time re-execute.In Partial Output caching, we can apply caching rules on different parts of pages.But Data Caching, I didn't understand.Could anyone please explain me Data Caching?Thanx in advance.
You already know about the ASP.NET GridView control. It uses pagination. Imagine if you have thousands of records that you want to display in your GridView and make pagination. It would be performance problem if you do not use Data Caching to store these thousands of records in Cache. This is only one example that can give you idea of data caching usage.
Here are some links (with examples) where you may read more about data caching:
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=149
http://aspnet.4guysfromrolla.com/articles/100902-1.aspx
Hope this helps.
Thank You Hajan.
As you said If I have thousands of records and want to show in Gridview.So what I understood from your example that when I first time hit the database, I will store all the data in cache(using Data cache) and when I need to show the data that time I will get from the cahce.
Am I right Hajan?
mohit said: Thank You Hajan.As you said If I have thousands of records and want to show in Gridview.So what I understood from your example that when I first time hit the database, I will store all the data in cache(using Data cache) and when I need to show the data that time I will get from the cahce.Am I right Hajan?
Exactly!
There are some advantages, but also disadvantages of Data Caching method. For example, if you have frequent changes in your database and need to re-fetch data and display back in the application data objects, doing a lot of caching may become not enough efficient. Still, it depends of the nature of your application. If you use the caching correctly, you will definitely improve the performance of your application. Take a look at the links I've posted in my previous post and reply back with your thoughts ;).
Thank you again Hajan. Your link is nice and helpful.:)
Now I can feel that I know about caching..Thanx again:)
mohit said: Thank you again Hajan. Your link is nice and helpful.:)Now I can feel that I know about caching..Thanx again:)
I'm glad I've helped!