ブログに戻る

フォロー&ご登録

英語のみで利用可能

このページは現在英語でのみ閲覧可能です。ご不便をおかけして申し訳ございませんが、しばらくしてからこのページに戻ってください。

Break Free from ESI Lock-in: Learn How to Migrate Today with Fastly

Tyler McMullen

共同設立者, Fastly

In the early 2000s, Edge Side Includes (ESI) was introduced by Akamai to help developers assemble dynamic content at the network edge. This helped improve performance and reduce origin load, and was the predecessor of today's edge computing.

But ESI never achieved true standardization and instead became a proprietary silo. More than twenty years later, the industry’s most mature organizations are feeling “ESI-stuck,” unable to migrate due to the thousands of ESI tags embedded deep within their content and infrastructure. Some of their most critical edge logic relies on features that have only ever been natively supported on Akamai. That vendor lock-in officially ends today.

A Path Forward: Enhanced ESI on Fastly Compute

Migrating decades of production ESI logic by rewriting everything in a standard programming language is just not viable. That's why Fastly has built a new robust ESI implementation powered by Fastly Compute, going beyond the VCL-based ESI support we have today.

We are happy to report that we now support many of the esoteric ESI features that were previously only available natively on Akamai. This is a high-performance engine that allows you to run your ESI tags on our global network while giving you the tools to eventually replace them.

What’s new with Fastly’s ESI Support?

Our Compute-based implementation adds support for the following critical features:

  • Control Flow: Handle simple logic in ESI via esi:choose tags, including regular expressions.

<esi:choose>
  <esi:when test="$(var) == 1">
    First Branch!
  </esi:when>
  <esi:when test="$(var) matches '''[0-9]+'''">
    Second Branch!
  </esi:when>
  <esi:otherwise>
    Otherwise branch!
  </esi:otherwise>
</esi:choose>
  • Error Handling: Gracefully recover when a service your ESI is talking to goes down via esi:try tags.

<esi:try>
  <esi:attempt>
    First choice
    <esi:include src="...">
  </esi:attempt>
  <esi:attempt>
    Second choice
    <esi:include src="...">
  </esi:attempt>
  <esi:except>
    Final fallback
  </esi:except>
</esi:try>
  • Variables and complex data types: Move beyond simple strings with support for arrays and dictionaries.

<esi:assign name="my_var" value="123">
<esi:assign name="my_list" value="[1,2,3,4]">
<esi:assign name="my_dict" value="{ 'one': 1, 'two': 2 }">
  • Interpolation: Simplify complex templating.

<esi:vars>
$(my_var) prints 123
$(my_list{0}) prints 1
$(my_dict{'two'}) prints 2
</esi:vars>
  • Logic & Math: Support for arithmetic and a wide variety of new functions.

<esi:assign name="letters" value="$string_split('1,2,3,4',',')">
<esi:assign name="one" value="(1 + 2) / 3">

The case for deprecating ESI

Wait, what? Why would we go through the work of building an ESI compiler, optimizer, and runtime only to suggest deprecating it? Hear us out. 

ESI is a templating language, not a programming language. While it might excel at taking structured data and formatting it into an HTML page, it was never designed to support the complexity of modern web applications. As edge computing has evolved, the limitations of ESI have become more apparent:

  • Scope: It’s hard to build robust logic in a language that lacks true programming primitives like loops, functions, and memory management controls.

  • Interoperability: Support across different platforms is inconsistent, resulting in significant vendor lock-in.

  • Stagnation: ESI has not evolved to meet developer needs like some of the more modern templating languages (check out: Handlebars, EJS, and Pug).

Today, we use edge computing for tasks far more complex than simply splitting page parts to achieve better caching. From stateful waiting rooms to decoding JSON web tokens to operating a pub/sub message bus at the edge, modern edge applications require a level of programmability and memory safety that ESI simply wasn’t built to handle.

Furthermore, we built this to demonstrate just how flexible our edge computing solution is. Being able to support languages as diverse as JavaScript, Rust, and ESI is part of the reason we built Fastly’s Compute the way that we did.

From templates to programs

With your ESI workloads running on Fastly, there's an immediate bridge from static templates to a fully programmable edge. We’ve worked hard to make sure your ESI tags function exactly as they did before. But now you have the opportunity to incrementally refactor your ESI workloads into more high-performance Rust or JavaScript logic and add critical features like passwordless authorization, edge-rate limiting, and so much more.

Ready to see how your ESI workloads perform on Fastly? Check out our implementation examples and documentation to get started.