c# - Caching in Asp.net (slidingExpiration and absoluteExpiration) -


hy,

how can use absoluteexpiration , slidingexpiration , if specify both of them :absoluteexpiration must datetime.maxvalue or slidingexpiration must timespan.zero.

cache.insert("cachetest", value, nothing,  ??,??; 

thanks,

for sliding expiration, use this:

cache.insert(key, value, nothing,              cache.noabsoluteexpiration, timespan.fromseconds(10)) 

for absolute expiration, use this:

cache.insert(key, value, nothing,              datetime.now.addminutes(2), cache.noslidingexpiration) 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -