user5061957
user5061957

Reputation:

HttpContext.Cache Property storage?

I am using HttpContext.Cache Property for checking multiple logins in asp.net website. I am adding combination of username and password to the cache item.

I want to know that where this HttpContext.Cache object will get stored ?at server side or client side? and what all are the drawbacks of saving such credentials on cache?? Please help

Upvotes: 3

Views: 1024

Answers (1)

PaulShovan
PaulShovan

Reputation: 2134

Cache is stored in server memory for a persistent period of time. Cache is created one per application.

The drawbacks of cache depends on how you want to use the cached data. For example, In comparison with session, cache will expire after a specified amount of time where session will stay there until the session ends.

On the other hand, ASP.NET can remove data from cache if there is lack of memory. Cache can not be kept externally (SQL Server etc.). It is not possible to share cache among several instances of web app.

Upvotes: 5

Related Questions