Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 609 Bytes

File metadata and controls

26 lines (20 loc) · 609 Bytes

I want to learn how a cache work!

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

Here is the code

Demo

ruby demo.rb

Tests

rspec cache_spec.rb