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
Post a Comment