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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajeesh MenothPosted Jun 9, 2015, 4:35 AM
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.
Rajeesh MenothPosted Jun 9, 2015, 5:03 AM
deepesh kumarPosted Jun 9, 2015, 5:02 AM
Shweta LodhaPosted Jun 9, 2015, 4:30 AM
Cache also provides application wide storage, but also provides for automatic expirations (to allow you to reclaim memory) and expiration callbacks.