You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ASPNET Core 8 session handling is calling a IDistributedCache.Refresh at the end of the request lifecycle if there were no Session.SetString(...) calls. If there was a Session.SetString(...) call, then ASPNET Core appears to not call the IDistributedCache.Refresh. This package uses a call to GetCacheItem(key, includeValue: false) for the refresh, but is also updating the expiration on the GetCacheItem call as well.
My particular use case is for ASPNET Core Session handling and the sliding expiration is quite long (30 mins). As such, I would prefer to not have two sliding window update DB calls per request, but just the single one for performance reasons.
I'm wondering if you would accept a PR that would provide an configuration option for UpdateExpirationOnGet? It could be defaulted to true to keep existing functionality.
There would only need to be a couple of changes to GetCacheItem and GetCacheItemAsync as follows: