I’m using redis lists and pushing to new items to a list. The problem is I really only need the most recent 10 items in a list.
I’m using lpush to add items to a list and lrange to get the most recent 10.
Is there anyway to drop items after a certain number? I’ll end up with lists that may have 1,000’s of items and can cause performance issues with latency.
Thank you!
After every
lpush, callltrimto trim the list to 10 elementsSee http://redis.io/commands/ltrim