In other words, a cache is a temporary storage area where frequently accessed data can be stored for rapid access. Once the data is stored in the cache, it can be used in the future by accessing the cached copy rather than re-fetching or recomputing the original data.
The CPU and hard drive frequently use a cache, as do web browsers and web servers.
The percentage of accesses that result in cache hits is known as the hit rate or hit ratio of the cache.
The data in these locations is written back to the backing store when those data are evicted from the cache, an effect referred to as a lazy write . For this reason, a read miss in a write-back cache (which requires a block to be replaced by another) will often require two memory accesses to service: one to retrieve the needed datum, and one to write replaced data from the cache to the store.
Alternatively, when the client updates the data in the cache, copies of that data in other caches will become stale. Communication protocols between the cache managers which keep the data consistent are known as coherency protocols.
The page cache in main memory, which is an example of disk cache, is usually managed by the operating system kernel.
Repeated cache hits are relatively rare, due to the small size of the buffer in comparison to HDD's capacity.
An example of this type of caching is ccache, a program that caches the output of the compilation to speed up the second-time compilation.
A cache's sole purpose is to reduce accesses to the underlying slower storage. Cache is also usually an abstraction layer that is designed to be invisible from the perspective of neighbouring layers.
Source: Wikipedia > Cache
What is QuickyWiki? QuickyWiki blends the depth of Wikipedia with the ease and speed of Cliffs Notes.