
8/28/2018 · Guest Author
What this post added
This post details the implementation of Edge Side Includes (ESI) using Cloudflare Workers to achieve high availability during a website migration. It describes how Workers can intercept requests, fetch fragments from both new and old backends, and stream the response, falling back to the origin if a new fragment fails. The worker code parses X-Fragments headers, initiates parallel fetches with timeouts, and streams the response body, replacing fragments with prefetched content or fallbacks. This enables a phased migration strategy by allowing parts of the page to be served by a new frontend while others remain on the legacy WordPress backend.