DEV Community

saintzzz
saintzzz

Posted on Originally published at fasttrack.vieschool.com

A Cloudflare Worker pinned my CDN deploy to an old commit - and prod silently served 5 stale releases

We found the stale deploy by comparing the HTML served in production with the HTML generated by the current release. Five releases had gone live in our app, but a Cloudflare Worker was still loading a pinned jsDelivr URL for an older commit. That meant the sameAs schema change we expected to see in prod never arrived.

The failure was easy to miss because the Worker and CDN were both serving valid responses. There were no build errors, no 5xxs, and no obvious outage. The page worked; it was simply serving old code.

What happened

The Worker imported a shared script from jsDelivr using a commit SHA in the URL. Pinning to a SHA gave us a stable dependency: the same Worker deployment would always fetch the same source. That stability was useful, but it also meant the URL would not move when we merged newer changes.

We treated the dependency as if it tracked the latest release. It did not. Each application deploy updated the main site, while the Worker continued fetching the old commit. We forgot the separate repin step.

Across five releases, the gap accumulated. The application’s source contained the updated structured data, including the new sameAs property, but the code path executing at the edge still came from the pinned revision. Since the browser received a successful response, the deploy pipeline had no reason to flag the mismatch.

How we detected it

We compared live HTML against the HTML from the current build, focusing on the rendered document rather than source files or deployment status. The live page was missing the schema property that the current build emitted.

That diff gave us a concrete symptom to trace: the template change was present in the application release, but absent from the response. From there, we checked the Worker’s imports and found the SHA in the jsDelivr URL. It matched the old revision, not the current one.

The important detail was where we compared. A green build only tells us that the new code compiled. A successful deploy only tells us that a deployment completed. Neither proves that the bytes users receive include the intended change. The live HTML diff tested the actual output at the edge.

The fix

We updated the Worker’s pinned URL to the intended commit and deployed the Worker. Then we fetched the production page again and verified that sameAs appeared in the rendered schema.

We also added the repin step to the release checklist. Any change to the shared script now requires a corresponding Worker dependency update. That makes the coupling visible, but it still relies on someone remembering the checklist.

A stronger follow-up is to make the pin explicit in version control and validate it during release. A small check can compare the SHA in the Worker import with the expected release revision, or fail when the shared script changes without an import update. The goal is to turn a manual memory task into a detectable mismatch.

What we learned

Immutable URLs are valuable because they make dependencies reproducible. They also create a maintenance obligation: updates are opt-in. If one deploy path uses a mutable package reference and another pins by commit SHA, those paths can quietly diverge.

For edge code, we now treat “deployed” and “serving the intended release” as separate checks. A live response check should cover the fields that matter, not just status codes. In this case, checking the rendered structured data would have caught the stale Worker immediately.

The same practice applies to any public page where a small markup change has operational consequences. For example, we use live HTML inspection on pages such as FastTrack VIE School to verify that production output matches the release we intend to ship. The link itself is incidental; the useful habit is comparing what the server returns with what the build says it should return.

Five releases passed while the edge code stayed pinned. The content was correct in the repository and stale in production. A simple diff between those two realities exposed the gap.

Top comments (0)