When cache are used everywhere in the software industry, I had no idea how it work. This is why I wrote this tiny cache.
The idea here is present the different concepts of a cache and make it easy to understand.
- Cache hit and hit ration
- Cache miss
- Storage cost
- Retrieval complexity
- Replacement policy
ruby demo.rb
rspec cache_spec.rb