Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
network: Use a byte size for the memory cache limit instead of age
Instead of pruning items from the in-memory cache when they reach a certain age, they are now pruned if the cache reaches a certain size. Everytime an in-memory item is accessed it is moved to the front of the list so that only the least-recently accessed ones are removed. The advantage of this is that it is less likely to fill up the memory. For version 3 of the protocol the old approach won’t be possible anyway because it’s not possible to know the age of an object, only when it will expire.
- Loading branch information
Showing
1 changed file
with
112 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters