1 Cache Buffer caching is a small but fast memory between the bit CPU and main memory because the CPU is much faster than the main memory, and the CPU reads the data from memory for a long time, The cache stores data that has just been used by the CPU or is recycled, so reading from the cache can be fast, reducing the CPU wait time and improving the performance of the system.
Cache is not cached files, is the cache block, I/O read and write the smallest unit is a block, the cache is generally used in the I/O request, if more than one process needs to access a file, then the file data into the cache, This allows the next process to gain control of the CPU and read the file data directly from the cache, improving the overall system performance
2 buffer buffers, which are used to store data transfers between devices with different speed and with varying priority, can reduce the time to wait for communication between different processes through buffer, and when the storage speed is faster than the storage speed of the device to communicate, the slow-storage device first put in buffer, A device that reaches a certain amount of storage is stored fast to read data in the buffer, in the meantime, storage of fast devices to do other things, buffer is generally written to disk
This article from "Xiao Xin" blog, declined reprint!
The difference between buffer and cache