Learn
What Is a Web Server? Web Server vs Application Server
A web server accepts HTTP connections, terminates TLS, serves static files from disk and forwards dynamic requests to ...
A cache is a small, fast storage layer that keeps copies of data close to where they are read, so repeat requests skip the slower original source. That is the core answer to what is a cache: a hit serves the stored copy on the spot, while a miss fetches from the origin, stores the result, then serves it. The word comes from the French cacher, "to hide," which is fitting: a good cache is invisible until it fails.
Under RFC 9111, the HTTP caching standard published in 2022, a response sent with Cache-Control: max-age=86400 may be reused for 24 hours without contacting the origin server. At a 95% cache hit ratio, the origin handles only 1 request in 20. That is why browsers, reverse proxies and CDNs all rely on caching to make pages and video start faster.
Every cache runs the same loop: compute a key, look it up, and decide whether the stored entry is still fresh. For HTTP, the key is the method plus the URL, extended by any request headers named in the Vary response header. A key that is too broad serves wrong content. A key that is too narrow fragments the cache and quietly destroys the hit ratio.
Freshness comes from the time to live (TTL): s-maxage for shared caches, max-age for everyone, Expires as a legacy fallback. Once an entry goes stale, the cache does not have to discard it. It can revalidate with a conditional request carrying If-None-Match (matched against the ETag) or If-Modified-Since. A 304 Not Modified reply refreshes the entry with headers only and no body, which costs one round trip but almost no bandwidth.
When the cache fills up, an eviction policy decides what leaves. Least Recently Used (LRU) is the common default. Least Frequently Used (LFU) and its hybrids protect long-tail content that is popular but bursty. Application caches add a write policy on top: cache-aside, write-through or write-back. Each one trades consistency against write latency.
Effective latency is the hit ratio times the hit latency, plus the miss ratio times the miss latency. The table assumes 20 ms for an edge hit and 200 ms for a miss that travels to a distant origin. These are illustrative round numbers, not measurements.
| Cache hit ratio | Origin requests per 1 million | Average latency |
|---|---|---|
| 80% | 200,000 | 56 ms |
| 90% | 100,000 | 38 ms |
| 95% | 50,000 | 29 ms |
| 99% | 10,000 | 21.8 ms |
Going from 95% to 99% cuts origin load fivefold while average latency improves by only about 7 ms, so origin capacity, not user latency, is where high hit ratios pay off.
Caching is the practice of storing a reusable copy of a computed or fetched result at a layer closer to the consumer. Each layer, from the CPU to the CDN edge, keeps its own cache with its own key, TTL and eviction rules. A single page view can be served from four different caches before reaching your application.
| Layer | What it stores | Approximate access time | Who controls it |
|---|---|---|---|
| CPU L1 to L3 | Memory lines | About 1 to 40 ns | Hardware |
| OS page cache | File blocks in RAM | Microseconds | Kernel |
| Application cache (Redis, Memcached) | Query results, sessions, rendered fragments | Under 1 ms in-datacenter | Your code |
| Browser HTTP cache | Responses for one user | Near zero network time | Cache-Control headers |
| Reverse proxy (Varnish, nginx) | Shared responses near the origin | Origin-region round trip | Proxy config plus headers |
| CDN edge | Shared responses near users | Typically 10 to 50 ms round trip | s-maxage, cache rules, purge |
The browser cache is private to one user, while proxy and CDN caches are shared, which is why personalized responses need Cache-Control: private or no-store.
CDNs usually stack two tiers: edge servers near users and an origin shield in front of the origin, so a miss at fifty edges becomes one fetch at the shield. Request coalescing goes further. When thousands of viewers ask for the same new HLS segment at once, the edge sends one origin request and fans the response out to everyone waiting. That is why a live stream can start fast without melting the packager. BlazingCDN's Anycast CDN with origin shield and request coalescing includes both on every plan and reports a 96%+ average cache hit ratio.
"Cached" means a response was served from a stored copy instead of being generated by the origin for this request. You can confirm it from the response headers. Age shows the seconds since the copy was fetched, and Cache-Status (RFC 9211) or a vendor X-Cache header reports hit or miss.
Request the same URL twice with any HTTP client that prints headers. A cacheable static asset served through a shared cache should show something like this on the second request:
If Age never increases and the status stays at miss, check for Set-Cookie on the response, Vary: User-Agent, or unique query strings. Each of these commonly prevents sharing.
Cache vs. buffer: a buffer holds data temporarily while it moves between producers and consumers at different speeds, and it is consumed once. A cache holds data so it can be read many times. Video players use both: a playback buffer of upcoming seconds and an HTTP cache of segments.
Cache vs. CDN: a cache is a mechanism, while a CDN is a distributed network of servers that runs caches near users and adds routing, TLS termination and purge tooling. Every CDN caches, but a cache does not need a CDN.
Cache vs. cookies: cookies are small key-value pairs a site deliberately stores to carry state such as sessions. Cached files are copies of responses kept for speed. "Clear cache and cookies" removes both, which logs you out and forces assets to download again.
Cached means the browser or an intermediate server reused a stored copy of a page, image or script instead of downloading it again from the website's origin. This makes repeat visits faster and cuts bandwidth. The risk is staleness: if the site changed but the cached copy is still considered fresh, you see the old version until the cache entry expires or is revalidated.
Yes, clearing the browser cache is safe and deletes no account data held by websites. The next visit to each site downloads its assets again, so pages load slower once. Clearing cookies at the same time is a separate step: it signs you out of sessions. Clearing the browser cache never affects copies held by CDNs or proxies.
For static assets, video segments and software downloads, a CDN cache hit ratio above 90% is a reasonable target, and well-tuned setups reach 95% or more. Dynamic or personalized traffic runs far lower. Track request and byte hit ratios separately, because the byte figure determines origin egress and bandwidth cost, while the request figure mostly reflects small-object behavior.
The no-cache directive lets a cache store the response but requires revalidation with the origin before each reuse, usually returning a cheap 304. The no-store directive forbids any cache from keeping the response at all. Use no-store for sensitive data such as account pages. Use no-cache when content must always be current but bandwidth savings still matter.
Pull one day of CDN or reverse proxy logs and compute two numbers: request hit ratio and byte hit ratio, split by content type. Then sort the misses by bytes. The top 20 URLs usually reveal the fix, whether that is a Vary header on User-Agent, a cache-busting query string, a Set-Cookie on static files or a TTL set to zero. Plug your numbers into the latency formula above to see what each extra point is worth to your origin. If heavy static files, video segments or downloads dominate that byte list, review the BlazingCDN caching features, including cache rules, purge and API warm-up, which are set up together with an engineer during onboarding of about one hour.
Heavy traffic.
Light bill.
The CDN for video and large traffic
Learn
A web server accepts HTTP connections, terminates TLS, serves static files from disk and forwards dynamic requests to ...
Learn
What is a proxy server? A proxy server is an intermediary that accepts a client's request, applies policy, and then ...
Learn
A reverse proxy is a server that sits in front of one or more origin servers, accepts client connections on their ...
Learn
Raising a CDN's cache hit ratio from 95% to 99% cuts requests reaching the origin by 80%, from 50,000 to 10,000 per ...