Caching is a technology that enhances the performance of websites by making them load faster. When used correctly, it can reduce the load on the server which results in lower server resource consumption. It stores the data temporarily in a variety of areas such as your CPU, hard disk, and DNS.
With the amount of technology behind making the dynamic sites work combined with large volumes of traffic going into these sites, a cache is very important to improve the user experience and lowering the cost of your hardware.
Caching can occur at many levels -
- Database (ex: XtraDB)
- Server (ex: Memecache)
- DNS/Networks (ex: Squid)
- Client’s browser (ex- headers)
Why is caching important?
- Reduces database cost
- Improves application performance
- Makes the overall performance predictable
- Eliminates database hotspots
- Increases Read throughput(IOPS)
- Reduces the load on the backend
Benefits of cache
- CPU cycle billing - the cache can save you money if you are billed by the CPU cycle because less of the CPU is used when reading a file rather than a complex database query.
- Bottleneck - If there is a bottleneck on your web service such as with your database, not calling the database as often and using cached database queries could help with that bottleneck.
- Faster UI - Storing cached files, whether in a file in the browser or a location on the server, can lower the amount of time needed to load the page. This can make a faster user experience and reduce bounce rate.