예제 #1
0
 /// <summary>
 /// Sets an absolute expiration date for the cache entry.
 /// </summary>
 /// <param name="options"></param>
 /// <param name="absolute"></param>
 public static StreamCacheEntryOptions SetAbsoluteExpiration(this StreamCacheEntryOptions options, DateTimeOffset absolute)
 {
     options.AbsoluteExpiration = absolute;
     return(options);
 }
예제 #2
0
 /// <summary>
 /// Sets how long the cache entry can be inactive (e.g. not accessed) before it will be removed.
 /// This will not extend the entry lifetime beyond the absolute expiration (if set).
 /// </summary>
 /// <param name="options"></param>
 /// <param name="offset"></param>
 public static StreamCacheEntryOptions SetSlidingExpiration(this StreamCacheEntryOptions options, TimeSpan offset)
 {
     options.SlidingExpiration = offset;
     return(options);
 }
예제 #3
0
 /// <summary>
 /// Sets an absolute expiration time, relative to now.
 /// </summary>
 /// <param name="options"></param>
 /// <param name="relative"></param>
 public static StreamCacheEntryOptions SetAbsoluteExpiration(this StreamCacheEntryOptions options, TimeSpan relative)
 {
     options.AbsoluteExpirationRelativeToNow = relative;
     return(options);
 }