c# - Implications of caching objects (per user) and garbage collection -


when store in asp.net's build in cache, how work garbage collector?

example:

if( not in cache) {   list<usersales> sales = salesservice.getbyuserid(loggedinuser.id);    inserttocache(cachekey, sales); } else {    // loads cache } 

so each user, first check if data in cache.

what want know is, effect have on garbage collector? if sales object has 200-500 rows users, how gc behave in situation?

what if have sliding expiration 20 minutes removed cache, because removed, still has gc'd correct?

the thing holding reference sales cache system, , mvc view page goes out of scope when requests ends.

the cache remove it's reference cached item when expires. if reference held page running cache item not eligible gc until request ends.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -