What Is Caching?

Caching explained

In short, it’s a method of storing data in memory so it can be quickly accessed.

There are 2 types of local caching –

  1. Memory Caching: High-speed static RAM, or SPRAM for short, is used. It’s a method of accessing data that is constantly used with SPRAM (which is fast because it stores data that is used over and over) instead of DRAM (which is slower as it stores most recently used data).
  2. Disk Caching: Main memory, or DRAM, is used. Most recently accessed data from the disk is stored in memory, a program first checks the disk cache to see if it’s there before going to the disk.

There are also 2 main forms of caching used within large networks –

  1. Reverse-Proxy Caching: Data is located on a web server that is used for caching and subsequently taking on client requests, this shields the origin server from requests.
  2. Forward-Proxy Caching: Servers deployed at various points on a large network, usually geographically like CDNs provide (Content Delivery Network), that cache data so it can be accessed quickly – For example, if you live in the USA and the origin server is located in the UK, you can use a CDN which will have a server in the USA where data is cached and can be pulled from.

Why is cache fast? For local caches it uses memory, or RAM, which is volatile and data can be accessed quickly because it’s stored randomly – Unlike hard disks which are slower because data is accessed sequentially, meaning when a search is performed the entire disk is checked from start to finish.

Caching on networks work differently as data is stored in several different locations around the globe – Instead of data being accessed from one point it’s cached on multiple servers. When a request is made the data is pulled from the nearest server from the client.

Advantages Of Caching

Local and network caching are different, both have their own strengths. Local caching speeds up data by storing it in RAM which can be grabbed thousands of times quicker than data from a hard disk. Network caching speeds up data on large networks (WAN – Wide Area Network) by passing it to servers close by so data can be quickly pulled.

There are many benefits of network caching such as server offloading and accelerating content delivery –

  1. Server Overload: Reduces server load, long-term server utilisation, and reverses capacity for non-cacheable content.
  2. Accelerate Content Delivery: Use fast memory cache to quickly serve client requests, send data without retrieving and assembling it, and shape and modify traffic.

Caching is an important method of speeding up data to get it to where it needs to be, CDNs for example are a great service to accomplish this by spreading data geographically to improve website speeds – Any website can benefit, like e-commerce, dynamic, static, and content managed.

Get started with a CDN today and signup for free with CDNify.

Enjoyed this blog post?