Edge Side Includes
Assembles a page from HTML fragments at the edge. The endpoint serves a parent file containing ESI tags, which Fastly processes to inject the child content before the response leaves the edge.
Endpoint
Internally serves /html/parent_esi.html.
How ESI works
Client Request → Fastly Edge
↓
1. Serves parent_esi.html
2. Detects <esi:include> tags
3. Fetches child_esi.html
4. Assembles final HTML
↓
Complete HTML Response
Assembly happens at the edge, so the client receives one complete document and never sees the fragments as separate requests.
ESI files
| File | Role | Cache-Control |
|---|---|---|
| parent_esi.html | Contains the ESI include tags. | private, no-store |
| child_esi.html | The fragment that gets included. | private, no-store |
Tag syntax
In the parent HTML file:
<esi:include src="/html/child_esi.html" />
Usage examples
curl https://your-service.edgecompute.app/fastly_features/esi
curl https://your-service.edgecompute.app/html/parent_esi.html
curl https://your-service.edgecompute.app/html/child_esi.html
Fetching the parent directly is the useful comparison. If the include tag comes back unprocessed, ESI is not running on that path.
Expected response
HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 Cache-Control: private, no-store [HTML with child content injected]
Notes
ESI processing must be enabled in your Fastly service configuration. Without it the parent file is served as-is and the include tag reaches the browser untouched, where it renders as nothing at all.
- Both files use
Cache-Control: private, no-storeso assembly runs fresh on every request. - An include that fails will break the response unless the tag carries
onerror="continue".
Ready to test?
Fetch the endpoint and compare it against the parent file served directly.
Try ESI now