Cache: Definition and All Fields Where Caching Is Used

Affiliate disclosure v3.1
Affiliate disclosure v3.2 (mobile)

We organized the fields where caching is used, from hardware to the web, into a single tree following the classifications of Wikipedia, MDN and the official WordPress documentation. CPUs, operating systems, databases and browsers all use the same name, so "clearing the cache" removes different things depending on the layer.

A cache temporarily stores data that is used often or will be needed soon in storage faster than the original, and when the same request comes in, it answers with that copy instead of the original.

The English Wikipedia article Cache (computing) divides caches into hardware caches such as CPU and GPU caches and software caches such as disk, web, DNS and database caches. The tree below groups this classification by where each cache sits, and web caches follow MDN's private cache and shared cache classification.

🗂️ Where caches are used
├─ 💻 Ⅰ. User devices
│ ├─ OS cacheDisk cache · DNS cache
│ ├─ Browser cacheThe HTTP cache's private cache
│ └─ Mobile app cacheThumbnails · session data
├─ 🖥️ Ⅱ. Server and application
│ ├─ Page cacheFinished HTML (WP Rocket · FastCGI cache)
│ ├─ OPcachePHP bytecode
│ ├─ Object cacheRedis · Memcached
│ └─ Web framework cacheLaravel · Django
├─ 🌐 Ⅲ. Content delivery · network
│ ├─ CDNThe HTTP cache's shared cache
│ ├─ Proxy cacheForward · reverse (Varnish)
│ └─ Network cacheARP cache · DNS resolver cache
├─ 🗄️ Ⅳ. Database · storage
│ ├─ DB internal cacheInnoDB buffer pool · Shared Buffers
│ └─ Storage cacheDisk controller · SSD DRAM
├─ ⚙️ Ⅴ. Hardware
│ ├─ CPU cacheL1 · L2 · L3 · TLB
│ └─ GPU cacheTexture · shader data
└─ ☁️ Ⅵ. Cloud · virtualization
├─ Container cacheDocker layers
├─ Serverless functionsWarm Start
└─ Build cacheCI/CD dependencies · outputs

You can check with a simulator the order in which browser, CDN and server-side caches handle a single WordPress request in the Website Cache & Server-Side Cache: How Caching Works in WordPress post.

Ⅰ. User Devices

  • ↳ Client-Side Cache

Caches on user devices such as personal computers and smartphones can be divided into OS cache, browser cache and mobile app cache.

Operating system (OS) cacheDevice memory (RAM)
What it storesData read from disk · domains and IP addresses

The disk cache (page cache) keeps data read from disk in memory and is managed by the operating system kernel. The DNS cache stores recently looked-up domains and IP addresses.

Disk cacheDNS cache
Browser cacheBrowser storage
What it storesHTML · CSS · JS · images · fonts

When the same resource is requested again, it either doesn't go to the server or only checks whether it has changed. With a Service Worker (Cache API), a web app can open from stored resources even offline.

private cacheService Worker
Mobile app cacheApp storage
What it storesThumbnails · part of the content · login state

Apps that handle large content store downloaded data and recently viewed lists on the device so they don't download the same data again.

YouTubeInstagram

Ⅱ. Server and Application Cache

  • ↳ Server-Side Cache

Server-side cache is the cache attached to the process of building a page after a request reaches the server. The official WordPress documentation explains it as caching plugins (page cache), object cache and server cache (opcode caches such as OPcache).

Page cacheServer disk · memory
What it storesFinished HTML page

For the same page request, it sends the stored copy without running PHP. There are caching plugins and web server caches.

WP RocketNginx FastCGI cacheLiteSpeed Cache
OPcacheServer memory
What it storesCompiled PHP bytecode

When the same file runs again, compilation is skipped. It has been built in since PHP 5.5.

opcode cache
Object cacheServer memory
What it storesQuery results · session data

It stores frequently used data in an in-memory store so the same query isn't repeated.

RedisMemcached
Web framework cacheApplication
What it storesTemplates · routes · query results

Web frameworks store rendered templates and query results in their own cache.

LaravelDjango

Ⅲ. Content Delivery / Network Infrastructure Cache

Network infrastructure caches answer with copies between visitors and the origin server, reducing physical distance and load on the origin server. In the HTTP caching standard, they are the shared cache used by many visitors.

CDNEdge servers
What it storesStatic files · pages

Delivers content from the server closest to the visitor among servers spread around the world. Its structure and benefits are covered in the What Is a CDN? Reasons to Use a CDN and 5 Benefits article.

CloudflareAkamaiFastlyQUIC.cloud
Proxy cacheProxy server
What it storesServer responses

A forward proxy stores responses on the client side, as in a corporate network, and a reverse proxy stores them in front of the server.

Varnish CacheNginx reverse proxy
Network cacheNetwork devices · DNS resolvers
What it storesIP–MAC address mappings · DNS lookup results

Network devices store IP–MAC mappings in the ARP cache, and ISP and public DNS resolvers store lookup results for the record's TTL.

ARP cacheDNS resolver cache

Ⅳ. Database and Storage System Cache

Because disk I/O is slow, databases and storage devices keep frequently read data in memory.

Database internal cacheDB server memory
What it storesFrequently read data · indexes

Keeps frequently read data and indexes in memory. The MySQL query cache was removed in 8.0; MariaDB still has it, but it is off by default.

InnoDB buffer poolPostgreSQL Shared BuffersMongoDB WiredTiger
Storage cacheMemory inside the storage device
What it storesRecent reads · writes

Memory built into the hard disk controller and DRAM inside the SSD store data temporarily, reducing I/O latency.

Disk controller cacheSSD · NVMe DRAM

Ⅴ. Hardware-Level Cache

Hardware caches are high-speed memory inside the CPU and GPU that process data faster than main memory (RAM).

CPU cacheInside the processor
What it storesInstructions · data · address translations

L1 exists separately for each core and is split into an instruction cache and a data cache, while L3 is shared by all cores. The memory management unit (MMU) stores the results of translating virtual addresses to physical addresses in the TLB.

L1L2L3TLB
GPU cacheInside the graphics processing unit
What it storesTextures · shader instructions · intermediate results

It raises GPU processing efficiency in games, 3D graphics and machine learning workloads.

Ⅵ. Cloud / Virtualization Cache

Cloud and virtualized environments reuse container images, function runtime environments and build outputs to shorten deployment and run times.

Container cacheBuild servers · registries
What it storesImage layers

A Docker image consists of several layers, and layers that haven't changed are not rebuilt or downloaded again.

Docker
Serverless functionsCloud runtime
What it storesRuntime environment

Keeps a finished invocation's runtime environment for a while and reuses it for the next call, reducing initialization time (Cold Start) (Warm Start).

AWS LambdaGoogle Cloud Functions
Build cacheCI cache storage
What it storesDependency libraries · compiled outputs

Shortens repeated build times.

GitHub ActionsGitLab CI

🔢 FAQ & Recommended Content

No. Clearing the browser cache removes only the copies stored on the visitor's device. The server's page cache and the CDN's copies are cleared by the site owner in the caching plugin or the CDN dashboard.

The first request right after clearing goes all the way to the origin, so it responds more slowly than usual. Once that request rebuilds the copy, later requests return to normal speed, and WP Rocket's [Preload] builds the copies in advance after clearing.

On Windows, the L1, L2 and L3 cache sizes are shown at the bottom of Task Manager under [Performance] → [CPU]. On Linux, you can check the same values in the output of the [lscpu] command.

💾 Cache-related posts 10 posts
🗂️ Cache
📋 Cache: definition and all fields 📄 Website cache & server-side cache
📋 WP Rocket settings guide 📝 Zend OPcache 📝 Installing Redis Cache
📝 What is a CDN? 📝 Varnish Cache
📋 WP Rocket speed test 📝 Speed improvement case 📝 Caching & Optimization Plugins

ℹ️ Affiliate Disclosure
This site's content contains affiliate links. When a visitor buys a product or service through one of them, the site receives a commission from the seller. The amount the buyer pays(it goes down during event discounts ↓)does not go up. Posted prices, discounts, and stock reflect the time of writing and may differ, so confirm with the seller before buying. Products are chosen and reviewed by our own standards, and commissions do not affect the order or content of reviews.

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove your humanity: 10   +   6   =