Cache vs Buffer
A cache is typically used to store frequently accessed data. The data in a cache changes over time but the cache itself may be permanent. Caches often have sophisticated designs that support random access to large stores of information. Algorithms to decide what to keep in the cache and what to push out can also be reasonably complex.Buffers have a far simpler design. They are typically only used once to improve the efficiency of a process such as a data transfer.Cache vs Buffer | ||
Cache | Buffer | |
Definition | Memory or data storage that is used to store frequently used data to improve service performance. | Memory or data storage that is used to compensate for the differences in speed between two processes that exchange or use data. |
Example | A web server that caches static versions of dynamic web pages. | A streaming media player that buffers music as a user is listening to it. |