Proper usage of caches can yield better performance, lower latency, reduce the server load (and thus, costs of running in the cloud), and help with scalability concerns (fewer servers required) – what's not to like?
If you're here for tips on CPU caches, you can find them in Chapter 11, Performance.
Caching is a big topic, so we'll only cover a few aspects of it here.
Caching works by simply storing the data that is read most often in non-persistent storage with fast access times. There are many different types of caches:
- Client-side caches: For storing data specifically for a given customer, often placed on the client's machine or browser.
- Web server caches:Â For speeding up reading from web pages, for instance, through HTTP accelerators such as Varnish that can cache the web server responses.
- Database caches:Â Many database engines have built-in, tunable caching.
- Application caches:Â For speeding up your application, which can now read...