Application object and cache object
difference between application object and cache object.......
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Jun 9, 2015, 12:35 AM EDT
1)Application object always stores data on the server side RAM
example: Application["hits"]=1;
(key-value pair).
2)Application object maintains its data till the web application is shut down or we release the data manually by assigning null or Clear() method is called.
3)Application object has no Timeouts or File Dependencies.
4)Its data can be assigned using Global.asax file
5)Application object is not used for performance optimization.
USED in maintaining hit counters, data from readonly files/tables which can then
be displayed on varrious web pages.
1)Cache object can store the data on server side RAM as well as client side RAM
example: -- Cache["data"]="asp.net";
2)Cache object maintains the static data as specified by the Absolute Expiration/ Sliding Expiration or File Dependency. The Time Period for Cache can be defined using the Cache.Insert() overloaded method or Cache.Add() method. It can be from seconds to years.
3)Cache object can be assigned data from web page and not from Global.asax file.
4)Cache is used for performance optimization. We retreive the Cache data from
the Cache without repeating the full cycle again, which is not so in the case
of the Application object.
Shweta LodhaRank #31 · 39.8K reputationPosted Jun 9, 2015, 12:30 AM EDT
Cache also provides application wide storage, but also provides for automatic expirations (to allow you to reclaim memory) and expiration callbacks.
deepesh kumar4 reputationPosted Jun 9, 2015, 1:02 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jun 9, 2015, 1:03 AM EDT