Layer the caches: "Varnish or Nginx cache handles repeat requests without touching PHP. OPcache makes PHP execution instant. Redis caches database queries and API calls. Each layer has a different invalidation strategy."
Opcode caching (OPcache): caches compiled PHP bytecode, eliminating the parse-compile step on every request — always enable in production. Preloading (PHP 7.4+) goes further by loading classes into memory at startup. Application caching: use PSR-6/PSR-16 cache libraries with backends (Redis, Memcached, APCu) to cache expensive computations, database query results, and API responses. HTTP caching: Cache-Control headers, ETags, and reverse proxies (Varnish, Nginx FastCGI cache) to serve responses without hitting PHP at all. Strong candidates discuss: cache invalidation strategies (TTL, event-based, tag-based), when to use APCu (single-server, fast) versus Redis (multi-server, persistent), and the hierarchy — HTTP cache prevents the request from reaching PHP, OPcache makes PHP execution faster, application cache avoids slow operations.
Tests performance architecture thinking. Candidates who only know one caching layer miss significant optimisation opportunities. Those who understand the cache hierarchy and can discuss invalidation strategies for each layer build high-performance applications.