Azure Redis 缓存是否在到期时刷新项目
Does Azure Redis Cache flushes items when expiration hit
我有一个场景,我计划设置 Azure Redis 缓存条目过期时间,以确保我们不会保留在特定时间点之后已知没有价值的数据,例如
cache.StringSet(this.cacheId, this.Serialize(), expiry);
此外,目的是防止 Redis 缓存性能因包含比实际使用的条目更多的条目而受到任何影响。
Azure Redis 是在达到定义的过期时间时刷新条目,还是仅在被迫减少内存占用和后端持久存储时才这样做?
Azure Redis 在过期前后使用标准的 Redis 行为,有关详细信息,请参阅 Redis Documentation。这是该页面的引述...
How Redis expires keys
Redis keys are expired in two ways: a passive way, and an active way.
A key is actively expired simply when some client tries to access it, and the
key is found to be timed out.
Of course this is not enough as there are expired keys that will never be
accessed again. These keys should be expired anyway, so periodically Redis
tests a few keys at random among keys with an expire set. All the keys that
are already expired are deleted from the keyspace.
我有一个场景,我计划设置 Azure Redis 缓存条目过期时间,以确保我们不会保留在特定时间点之后已知没有价值的数据,例如
cache.StringSet(this.cacheId, this.Serialize(), expiry);
此外,目的是防止 Redis 缓存性能因包含比实际使用的条目更多的条目而受到任何影响。
Azure Redis 是在达到定义的过期时间时刷新条目,还是仅在被迫减少内存占用和后端持久存储时才这样做?
Azure Redis 在过期前后使用标准的 Redis 行为,有关详细信息,请参阅 Redis Documentation。这是该页面的引述...
How Redis expires keys
Redis keys are expired in two ways: a passive way, and an active way. A key is actively expired simply when some client tries to access it, and the key is found to be timed out.
Of course this is not enough as there are expired keys that will never be accessed again. These keys should be expired anyway, so periodically Redis tests a few keys at random among keys with an expire set. All the keys that are already expired are deleted from the keyspace.