Which type of caching is best?

Posted by Gopesh9 under ASP.NET on 8/7/2012 | Points: 10 | Views : 2986 | Status : [Member] | Replies : 2
Hey,

There are mainly three types of caching used in ASP.NET.

1. Output Caching.
2. Fragment Caching.
3. Data Caching.

I just want to know, which type of caching is best and why?

G. S.
.Net Developer



Responses

Posted by: Sheonarayan on: 8/7/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
There is no clear cut answer for this. It depends on scenario and uses. All are for specific purposes

1. Output Caching - It is used when you want to catch the entire output of the asp.net page.
2. Fragment Caching - It is used in case you want to catch the portion of the page, to implement this you will need to bring that portion in user control and use the caching.
3. Data Caching - It is used to cache the frequently used data by the users of the application. Eg. you are getting a data from the database after complicated procedure and you do not want to execute this procedure again and again then you can save this data into Cache and use it every time this data is requested for.

Read about Fragment caching here http://www.dotnetfunda.com/articles/article1484-how-to-implement-fragment-caching-in-aspnet.aspx .

Hope this helps.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Gopesh9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopesh9 on: 8/7/2012 [Member] Starter | Points: 25

Up
0
Down
Thank you for your answer, but may be there is some scenario whether we can say that this caching is best from the other one.

G. S.
.Net Developer

Gopesh9, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response