Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Application and Cache in ASP.NET?

What the difference between Application("some-object") and Cache("some-object") in ASP.NET?

like image 288
Shawn Avatar asked Sep 25 '08 22:09

Shawn


2 Answers

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.

like image 136
Quintin Robinson Avatar answered Oct 07 '22 09:10

Quintin Robinson


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.

like image 43
bang Avatar answered Oct 07 '22 09:10

bang