DistributedCacheEntryExtensions.SetSlidingExpiration(DistributedCacheEntryOptions, TimeSpan) 方法
定义
设置缓存项在被删除之前可以处于停用状态(例如不被访问)的时长。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).
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Caching::Distributed::DistributedCacheEntryOptions ^ SetSlidingExpiration(Microsoft::Extensions::Caching::Distributed::DistributedCacheEntryOptions ^ options, TimeSpan offset);
public static Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions SetSlidingExpiration (this Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, TimeSpan offset);
static member SetSlidingExpiration : Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions * TimeSpan -> Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions
<Extension()>
Public Function SetSlidingExpiration (options As DistributedCacheEntryOptions, offset As TimeSpan) As DistributedCacheEntryOptions
参数
- options
- DistributedCacheEntryOptions
要操作的选项。The options to be operated on.
- offset
- TimeSpan
可调到期时间。The sliding expiration time.