Cache
From TPU Reference
Cache is a fast type of memory (relative to what it is caching) used as a buffer. By using a cache, communication between devices can be boosted. Cache can be found in many types of hardware, however the most common uses are in processors and I/O devices. Commonly used data from a slower source can be stored and accessed faster.
Examples
- Processor
Cache in a processor is a lot faster than the system RAM, thus pieces of data that are used more often are cached for faster access. Basically the cache is a piece of ultra-fast system RAM, as the system RAM works as a (relatively huge) buffer as well. There are usually different levels of caches in processors, with level 1 cache having the lowest latency and level 3 cache having the highest (although still significantly lower than accessing the RAM). Generally smaller caches have lower latencies, but also have lower hit rates (the chance of the processor finding the data it needs). If the first cache doesn't contain the data, then the processor will search the next and so on, until it needs to search the system RAM.
- Hard disk
A hard disk is a relatively slow medium; its interface is often several times as fast. By placing data in the drive's cache first the bus can be used more efficiently. Burst speeds from the cache can be nearly as high as the bus' maximum bandwidth.
- The Internet
The world wide web is perhaps the simplest example of how cache really works. When you visit techPowerUp! from the other side of the world you need to connect to the other side of the world and retrieve the data there, which takes quite long. However, when using a cache (proxy or ISA server for example) a server in between, the cache, stores commonly requested data locally. So because you visit techPowerUp! often the server, which is located closer to you than the actual techPowerUp! server (it could be at your ISP or even in your home/company network), will store the data from techPowerUp! on its hard disk. Now when you request techPowerUp! again instead of forwarding your request to the other side of the world the cache will retrieve it from its hard drive and send you the data itself. This way the data is accessible a lot faster and bandwidth is saved. Now imagine there being 200 people in an office going to techPowerUp!, the first will retrieve it from the other side of the world, the other 199 people will get from the cache, this means LAN speed and the internet connection staying free for other uses.
