c# - MemoryCache Aspnet MVC -
i've problem implement memorycache object in aspnet. code
objectcache cache = memorycache.default; cacheitempolicy policy = new cacheitempolicy(); policy.absoluteexpiration = datetimeoffset.now.addseconds(10.0); cache.add("keyname", resultquery, policy);
the object correct insert in cache when delete , rewrite new object in view visible in session.
var q = queryobject; var cachekey = "keyname"; memorycache.default.remove(cachekey); objectcache cache = memorycache.default; cacheitempolicy policy = new cacheitempolicy(); policy.absoluteexpiration = datetimeoffset.now.addseconds(10.0); cache.add(cachekey, q, policy);
and simple implementation.
cache.get(cachekey);
i don't understand why works in different browser session , doesn't work. can me? thanks.
Comments
Post a Comment