Reputation: 19803
What the difference between Application("some-object")
and Cache("some-object")
in ASP.NET?
Upvotes: 5
Views: 9703
Reputation: 51822
Upvotes: 1
Reputation:
Application and cache are both application level storage of item, but difference is that in usage cenario , like cache is more flexible can do much more like scavenges ( removes unimortent item from cache automaticaly) ,but cache on othere side is volatilemeans that it is not sure that data will stay for application life .But Application is more relaibrel ,data stays when ever application is running but it is simple .
Upvotes: 1
Reputation: 5221
According to MS, Application storage is only preserved for backward compatibility with classic ASP applications so use the Cache because it's smarter and thread-safe.
Upvotes: 4
Reputation: 82345
Application is an application wide, no timeout (except when the pool restarts) dictionary. The cache is a temporary repository for common cache storage.
This And This might help clarify the differences and usages.
Here is another one.
Upvotes: 9