Skip to content

Cache aware verification

Bryan Hamilton edited this page Nov 7, 2026 · 1 revision

Cache-aware verification

The most expensive sentence in this whole pattern is: "I deployed the fix and nothing changed." Nine times out of ten, the fix is live and four cache layers are each showing you a different decade.

The layers, in the order they lie to you

  1. Your own browser. Hard-refresh (Cmd/Ctrl+Shift+R) or test in a private window before you form any hypothesis at all.
  2. Server page cache (LiteSpeed, FastCGI cache, WP caches). Full-page HTML is cached for minutes by default. Cache-bust every check: append ?cb=1783123456 (any changing value) to the URL.
  3. opcache / bytecode cache. PHP files you just wrote may keep serving the old bytecode until revalidation kicks in. opcache.revalidate_freq of 60 means up to a minute of stale logic on a perfect deploy. If you control it, opcache_reset() via a one-shot worker; if not, wait out the TTL before declaring failure.
  4. CDN / edge. Purge it, or verify against the origin directly.

The verification rule

Verify the new behavior, not the absence of the old one. "The banner is gone" fails when the banner was already gone for other reasons. "The page contains data-djc-fixbanner1" cannot pass on a stale file. Your worker should already be printing byte counts and marker checks - read them:

OK fixbanner1: .legacy-banner hidden
bytes: 269602 -> 269692
done - worker self-deleted

Then confirm the marker survives one more cache-busted fetch from the public URL. If the worker says patched but the public page disagrees, you have a cache problem, not a code problem - go find which layer, and do not write a second patch while the first one is still in flight to production.

The ghost-bug corollary

Front-end bugs deserve a clean reproduction before a patch: fresh headless browser, no cache, no extensions. A bug that refuses to reproduce headlessly is usually stale cache, a logged-in state, or an extension - not your code. Patching a ghost is how you get two bugs.

Clone this wiki locally