Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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


1 Answers

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.

like image 142
PaulShovan Avatar answered Jun 12 '26 10:06

PaulShovan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!