Available in all subroutines.

Flags a request for parsing edge side includes. Parsing occurs after the vcl_deliver subroutine has finished, so this statement has no effect if executed in vcl_log.

In order for the ESI parser to detect <esi:... tags in the response stream, the response cannot be compressed. Compressed responses will obfuscate the ESI tags and they will be delivered unprocessed to the client.

Try it out

esi is used in the following solution recipes. Recipes apply VCL to real-world use cases and can be deployed as-is, or adapted for your own service. See the full list of recipesfor more inspiration.

Click RUN on a sample below to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

Relative date insertion using ESI

Generate relative time datelines like "3 minutes ago" at the Edge instead of in JavaScript or at origin. Better caching, faster rendering, fewer reflows.

Edge-side includes (ESI)

Use Fastly's support for ESI to combine multiple origin-hosted objects into a single response at the edge.

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.