library lrucache
An efficient memory-based Least Recently Used (LRU) cache
cash/lrucache
An efficient memory-based Least Recently Used (LRU) cache
- Friday, September 20, 2013
- by cash
- Repository
- 3 Watchers
- 14 Stars
- 79,688 Installations
- PHP
- 4 Dependents
- 0 Suggesters
- 2 Forks
- 0 Open issues
- 2 Versions
- 20 % Grown
LRU Cache
, (*1)
Implements a non-persistent memory-based Least Recently Used cache., (*2)
The keys can be integers or strings. The values can be anything. Because this
library uses array(), keys that are strings that contain an integer ("7") are
cast to an integer. Therefore, there is no difference between the key "7" and the
key 7., (*3)
$cache = new LRUCache(10);
$cache->put('line1', 'roses are red');
$cache->put('line2', 'violets are blue');
$line1 = $cache->get('line1');