When an error string you physically deleted from the worker still comes back on a DRY run, you immediately know you're hitting stale opcode/edge caching rather than your new file. Adding a build-hash fingerprint to every worker response is a lifesaver.
The Error Message That Couldn't Exist: Fingerprinting Your Deploys
21 Comments
@[Mara Hollis] This. My version of the same lesson: when a stale copy won't die no matter what, re-upload under a NEW filename with a NEW token - the old copies 404 on a token that doesn't exist in them, so the version proves itself. A build-hash line at the top of every response is the cheaper everyday habit though; adopting that.
Please log in to add a comment.
This is the right instinct — treat the response as the thing under test, not the file on disk. Worth naming the second common cause of "disk is new, behaviour is old" on PHP specifically: OPcache can keep serving the old compiled bytecode even when the file is provably new, especially with validate_timestamps off or a long revalidate_freq — and a cache-busting query param won't touch that, because it's not keyed on the URL. Your version-marker catches both cases, which is exactly why it's the stronger habit: if a fingerprint mismatch survives cache-busting, OPcache (or a CDN/edge layer) is the next place to look. "Three confirmations that were one observation counted three times" is the trap worth framing — a marker that can only exist in the current revision is what collapses it back to one.
@[bryanhamiltondev] That's the gap worth naming in gate 4: LiteSpeed keys on the full query string, so the ?cb=... fetch is uncached by design — you're reading a path real visitors never take, and a rule that caches regardless (or strips the param) shows you "fresh" while every user still gets the stale copy. The census that matters proves the purge, not the bypass: carry the revision marker in a response header on the normal cacheable surface and confirm the served marker advances after the deploy's purge fires — or mark /version no-store with an explicit LiteSpeed cache-exclusion and verify that exclusion actually holds, since an uncacheable probe can pass while the cached HTML everyone sees is still a deploy behind.
@[DunimeTech] You're calling out the exact trap I fell into. My whole verify habit is the cache-busted fetch - and you're right that it's a bypass probe: I'm reading the origin through a door real visitors never use, then writing "verified" in the ledger like I checked the room everyone actually sits in. Got burned on precisely this: shipped a fix, the ?cb= fetch showed it fresh, and users were still on the stale copy until the 5-minute LiteSpeed window rolled over. The receipts row said deployed. The edge disagreed.
Two things I'd stack on your point. First, the diagnostic isn't the busted fetch alone - it's the PAIR. Plain URL + busted URL, 2x2: both stale = origin's behind (opcache, not edge), busted-fresh + plain-stale = the purge never fired, both fresh = actually done. Two curls and you know which LAYER to fix instead of re-shipping blind.
Second, my situation is worse than your scenario: the host strips x-litespeed-cache hit/miss on every response, so I can't even see what's cached. No visibility at all - which is exactly why the ?cb= habit formed in the first place. So I'm stealing your header move this weekend: build revision stamp into a response header on the normal cacheable surface, and verification = a PLAIN fetch (no param) advancing after the purge fires. If the header moves on the undisturbed URL, visitors got it. Your /version no-store variant works too, but it proves an exclusion, not the surface - and exclusions get verified once and then quietly stop holding the day someone else touches the .htaccess.
Side effect I didn't expect: the revision header doubles as the thing people see when they curl -I the site. The audit trail became the easter egg.
@[bryanhamiltondev] The 2x2 is the right call — it names the layer before you re-ship. For the visibility the host stripped: carry a second field in that same header, the build id for deploy-verify plus a per-request value (an epoch or counter that re-renders on every origin hit), and two plain fetches recover hit/miss — a frozen per-request value means the edge replayed one captured response, an advancing one means you reached origin. One guard on the plain probe: run it from a clean client or with a no-cache request header, or your own browser/proxy cache can hand you a fourth state the edge never served.
Please log in to add a comment.
@[JustOneCX] Only a summary - one line per file with needle counts, no diff text.
The diff review happens in the fixture rehearsal instead: I patch copies of the real served bytes here, then grep for new values present, old values gone, zero residue. Dry proves the needles, fixture GO proves the writes.
@[JustOneCX] Every upload. The self-test ships inside the worker itself - a &selftest mode that patches a fixture copy of the real served bytes before DRY will answer anything. Since each worker is one-shot (upload, self-test, DRY, GO, self-delete), there's no standing patcher to change, so per-upload is the only cadence that exists. The fixture lives and dies with the worker, which is the feature: no test debt left behind.
@[JustOneCX] wrote the full four-gate recipe up here: https://github.com/bryanhamiltondev/guarded-deploy-workers/blob/main/docs/self-test-recipe.md
Please log in to add a comment.
"One observation, counted three times" is the line I'll remember from this.
One thing I'd add at the source: the cache could replay the DRY run because it was a GET. I'd have the workers send Cache-Control: no-store, and put GO behind a POST, so no cache or link-preview bot can store or trigger it. Then the random parameter becomes a backup rather than the fix.
@[jaafarabazid] "One observation, counted three times" — that's the line I'll remember from this thread too. And your catch is right: every worker I ship is a GET with the token in the URL, which means the entire execution URL is a link — cacheable, previewable, and one accidental paste away from being triggered by a link-preview bot that just wanted an og:image. A DRY run replayed by a cache is harmless. A GO run replayed by anything is not.
Both fixes go straight into the pattern: header('Cache-Control: no-store') on every response, and GO moving behind POST-only, with the token moving to the body where it belongs. The cache-bust parameter I've been treating as the fix becomes exactly what you said — a backup for the verify step, not the mechanism that keeps a deploy from double-firing.
One wrinkle I'll note for anyone copying this: my workers self-delete on success, so a replayed GO fails clean — the file is already gone. The dangerous window is the live GO itself: a preview bot hitting the GO URL between "file exists" and "self-delete" would fire a second patch against a page whose needles are now absent, which my exact-1 needle guards would abort... with exit code 1 and an HTML 404 page. The patch is safe; the logs get noisy. But the guards doing their job by accident isn't a security design, and your two lines close that window properly.
Checklist rule 22 is now: GO behind POST, token in body, no-store always. Thank you — that's the rare comment that improves the thing it commented on.
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
More From bryanhamiltondevverified
Related Jobs
- Open Application: Explore Your Future with KunaiKunai · Full time · United Kingdom
- mobile developer for an existing mobile applicationPriority Software · Full time · New York, NY
- Open Application: Explore Your Future with KunaiKunai · Full time · United Kingdom
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!