How does a cache work?
When a datum is needed, the cache is checked to see if it contains the datum. If it does, the datum is used from the cache, without having to access the main data store. This is known as a ‘cache hit’. If the datum is not in the cache, it is transferred from the data store; this is known as a ‘cache miss’. When the cache fills up, items are ejected from the cache to make space for new items.