When trying to use IDistributedCache, associated with Couchbase.Extensions.Caching, there seems to be a possible issue when using the AbsoluteExpiration or AbsoluteExpirationRelativeToNow options that are used by DistributedCacheEntryOptions. If either AbsoluteExpiration property is set, while using an ephemeral couchbase bucket, the document is cached but is seemingly deleted instantly from the bucket.
Environment Used
The local couchbase instance is deployed via docker and uses enterprise-5.1.0
Steps To Reproduce
Use Couchbase.Extensions.Caching in a .NET project and add AddDistributedCouchbaseCache to the startup configuration
Using Dependency Injection, retrieve an IDistributedCache in a repository class
Call the SetAsync method and pass in a option parameter with the Absolute property set;
Example:
await _cache.SetAsync(docKey, serviceResult.Value, new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(15)});
Attempt to retrieve document using GetAsync returns null and inspection of the ephemeral cache bucket shows no document exists
Side Note
SetAsync seems to successfully cache and retrieve a document when neither of the AbsoluteExpiration properties are set
Summary
When trying to use IDistributedCache, associated with Couchbase.Extensions.Caching, there seems to be a possible issue when using the AbsoluteExpiration or AbsoluteExpirationRelativeToNow options that are used by DistributedCacheEntryOptions. If either AbsoluteExpiration property is set, while using an ephemeral couchbase bucket, the document is cached but is seemingly deleted instantly from the bucket.
Environment Used
The local couchbase instance is deployed via docker and uses enterprise-5.1.0
Steps To Reproduce
await _cache.SetAsync(docKey, serviceResult.Value, new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(15)});
Side Note
SetAsync seems to successfully cache and retrieve a document when neither of the AbsoluteExpiration properties are set