Replying to Avatar Juraj

Do you really need cache for reads twice day? And when most items are not accesed whole week? At least prune it every 3 days.

Reply to this note

Please Login to reply.

Discussion

Pruning is costly too, lazy pruning is easier - when you want to cache something, remove something else to the dirty laundry basket. There's no reason to prune O(1) cache if it is not full, that actually adds complexity.

But it usually does not have O(1), but stored in a stack where you cannot get middle of it without additional operations.