MichaCo / CacheManager

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
http://cachemanager.michaco.net
Apache License 2.0
2.33k stars 458 forks source link

LastAccessedUtc not working on Redis #270

Closed dorgold closed 5 years ago

dorgold commented 5 years ago

CacheItem retrieved from Redis Cache has LastAccessedUtc always set to DateTime.UtcNow.

Expected behaviour: LastAccessedUtc should be populated with the last time this Redis key was accessed

This can be implemented using the OBJECT IDLETIME command in Redis

MichaCo commented 5 years ago

Well, the key gets accessed when the item gets read or updated, and that's where the LastAccessedUtc field gets set. It is mostly used to track expiration locally and I think its totally fine how and when its set for its purpose.