Glossary

Cache Server

A cache server stores copies of data that is expensive to produce or far away, and hands them out directly, so the original source does less work and users wait less.

What is a cache server?

It is a machine whose main job is remembering answers. The first time someone asks for a page, an image or the result of a query, the cache forwards the request to the source, called the origin, keeps a copy of the response and returns it. The next request for the same thing is answered from the copy in microseconds or milliseconds instead of running the full work again. A good cache absorbs most of the traffic, which lets a modest origin serve far more users.

What kinds of cache server exist?

KindStoresCommon softwareMain resource
HTTP reverse proxy cacheWhole responses: pages, images, video segmentsnginx proxy_cache, VarnishDisk and port speed
In-memory data cacheObjects, sessions, query resultsRedis, Valkey, MemcachedRAM
Package or artifact cacheDownloads for build systems and serversapt-cacher-ng, registry mirrorsDisk
DNS cacheName lookupsUnboundTiny

The in-memory kind is covered in detail on In-memory caches and stores.

What is a hit ratio and why does it matter?

The hit ratio is the share of requests answered from the cache. At 90 percent, the origin sees one request in ten; at 99 percent, one in a hundred. Small changes near the top make a large difference to the origin's load, so most cache tuning is about raising the hit ratio: caching more types of response, keeping objects longer, normalizing URLs so the same content is not stored under many keys, and giving the cache enough memory or disk to hold the popular set. nginx can report it per request with $upstream_cache_status in the access log.

How long should things stay cached?

Each object gets a time to live (TTL). Static files with versioned names can stay for a year. HTML for logged-out visitors might be cached for a minute, which already cuts load enormously at busy times. Personalized pages and anything after login should usually not be cached at the HTTP layer at all. When content changes before its TTL runs out, you invalidate it: purge the key, or include a version in the URL so the new copy has a new key. Stale-while-revalidate settings let the cache serve a slightly old copy while it fetches a fresh one, which hides origin slowness from visitors.

What hardware suits a cache server?

An in-memory cache is all about RAM; CPU barely matters unless request rates are extreme, and Redis uses one main thread per instance anyway. A disk cache for files wants fast NVMe and, above all, network capacity, because its whole purpose is sending data out.

  • Session and object cache for a few apps: S5 with 128 GB DDR4.
  • Large shared data cache: M1 with 512 GB DDR4, or M13 with 1 TB DDR5 at the top end.
  • HTTP cache for downloads or video: S13 with a 2x 25 Gbps connection and NVMe storage.

Where should a cache server sit?

Close to whoever asks. An application cache belongs in the same city as the app, so every lookup is a sub-millisecond hop. An HTTP cache for visitors belongs near the visitors. With identical models in Phoenix, Ashburn, Chicago, Seattle, Amsterdam and Singapore, you can keep one origin and add caches where your audience is, such as Amsterdam for Europe and Singapore for Asia. Every cache in another city fetches content from the origin over the public internet, which counts as outgoing traffic on the origin, and then serves it many times, which counts on the cache.

Cache server or bigger origin?

If the same responses are requested again and again, a cache is cheaper than scaling the origin, because serving a stored copy costs almost nothing. If every response is unique, as with search results for rare queries or personalized dashboards, a cache helps little and the origin needs the capacity. Measure first: log how often the same URLs or keys repeat over an hour, and the answer is usually clear.

Related ideas: a Proxy server is the broader term that includes caching proxies, and Latency explains why distance to the cache matters.

Machines Built Around Memory and Bandwidth

ServerProcessorCores / threadsMemoryStorageNetworkPer monthSmallest order
S5Intel Xeon E-2276G6 / 12128 GB DDR42x 1 TB NVMe2x 10 Gbps$88.72$88.72 (1 month)
S13AMD EPYC 4345P8 / 16128 GB DDR52x 2 TB NVMe2x 25 Gbps$237.92$237.92 (1 month)
M12x Intel Xeon Gold 5315Y16 / 32512 GB DDR42x 4 TB NVMe2x 25 Gbps$414.70$414.70 (1 month)
M62x Intel Xeon Gold 6258R56 / 112768 GB DDR42x 2 TB NVMe2x 25 Gbps$664.12$664.12 (1 month)
M132x Intel Xeon Gold 5418Y48 / 961 TB DDR52x 4 TB NVMe2x 25 Gbps$849.12$849.12 (1 month)

Keep Reading

In-memory caches and stores

Redis, Valkey or Memcached on machines with 128 GB to 1 TB of RAM, sized with snapshot headroom and NUMA in mind.

Open

Proxy server

A server that sits between clients and destinations and forwards their traffic, in forward or reverse form, for control, caching or privacy.

Open

Latency

Why distance sets the floor for ping time, how to estimate round trips between our six cities and how to choose a location.

Open

In-memory databases

How databases that live in RAM work, how they survive restarts, which engines to consider and how to size the machine with fork headroom.

Open

FAQ

Quick Answers

A CDN is a network of many cache servers in many places. A single cache server is one of those building blocks, run by you.

Redis is often used as one, storing objects and sessions in memory. It can also act as a database, queue or message broker.

It evicts entries according to a policy, usually least recently used, to make room for new ones.

Generally not at the HTTP layer. Cache the data behind them in an object cache instead.

RAM for in-memory caches, and port speed plus fast disks for HTTP and file caches.