Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




.NET and ASP.NET interview question -Elaborate differentiation between Cache and Application?

Answer:
 

Application and Cache both help to share global data and cache data across the users.but cache object is proactive and you can define dependency.In application object you can't define depenency.

Below is the code for declaring application and cache object.

CacheDependency objCacheDependency = new CacheDependency(Server.MapPath
("Banner.txt"));
Cache.Insert("Banner", strBanner, objCacheDependency);
Application["Banner"] = "strBanner";

In the above code, for Cache object you can define dependency but in Application object you can't define dependency.when the banner file is changed the Cache object can be refreshed but the application remain static and holds the old text of banner file.

Please click here to see more .NET/ASP.NET interview questions

Regards,

Visit Authors blog for more ASP.NET interview questions

 

Share this article   |    Print    |    Article read by 3842 times
Author:
Shivprasad koirala Koirala
I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. Do visit my site http://www.questpond.com for .NET, C# , design pattern , WCF , Silverlight , LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server training and Interview questions and answers
Related Articles: No related article
Related Interview Questions: No related interview question