I find there are "absexp","sldexp" and "data" fields in a Redis hash key.
I can use _radius.setString/getString to set and get the value of field data. But how can I modify the field "absexp" in the ASP.NET core project?
Are you trying to change the cache expiration?
Use code like this to create an DistributedCacheEntryOptions object and assign when you set the value to cache so:
var options = new DistributedCacheEntryOptions(); // create options object
options.SetSlidingExpiration(TimeSpan.FromMinutes(1)); // 1 minute sliding expiration
_cache.SetString(cacheKey, value, options); // set key value pair with options
// your value will now expire after one minute
Absolute expiration can be set with a similar method on the option object if you don't want sliding expiration.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With