Wednesday, March 14, 2012
.NET and ASP.NET interview question -Elaborate differentiation between Cache and Application?
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.
Subscribe to:
Post Comments (Atom)
Could not find a part of the path ... bin\roslyn\csc.exe
I am trying to run an ASP.NET MVC (model-view-controller) project retrieved from TFS (Team Foundation Server) source control. I have added a...
![](https://i.stack.imgur.com/lkxJP.png)
-
Adding the New HTML Editor Extender to a Web Forms Application using NuGet : The July 2011 release of the Ajax Control Toolkit includes a ne...
-
In Visual Studio 2012, if you create a ADO.NET Data Model then the generated Context class derives from a type called DbContext instead of...
-
Building your first Windows Metro style app using C#, C++, or Visual Basic [This documentation is preliminary and is subject to change.] ...
No comments:
Post a Comment