
8/20/2018 · Stephane Nouvellon
What this post added
This post introduces the implementation of Edge-Side-Includes (ESI) using Cloudflare Workers. It details how Workers can be used to dynamically fetch and combine content from different sources, enabling caching of static portions of a page while dynamically rendering dynamic fragments. The post provides a code example of a Worker that intercepts text-based responses, identifies ESI blocks, fetches the content specified in the `src` attribute of `<esi:include/>` tags, and merges it with the static content before sending the final response to the visitor. It also discusses the use of TransformStream for efficient streaming and the importance of `cache-control: max-age=0` for dynamic content.