hackpar / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

new expire policy request #442

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1、set a maxsize of hash
2、put data in hash
3、expire those data accessed longest time ago

Original issue reported on code.google.com by p...@juyide.com on 25 Jan 2011 at 5:54

GoogleCodeExporter commented 8 years ago
Redis doesn't keep LRU for hash fields. You can simulate this by keeping a 
sorted set for every hash where you want to do this, and store the timestamp 
for every time you access a hash field. Then, you can use ZRANGE to check if 
you need to purge fields from the hash.

Original comment by pcnoordh...@gmail.com on 7 Mar 2011 at 11:42