Edge-side includes allow a web app to serve up less data and have the CDN stitch in boilerplate. For example, a forum might serve something like this up, and then the edge replaces the include directives with HTML that may or may not already be in the cache:
<? include "head.html.inc" ?>
<section class="post"><? include "user/ryanerwin/posthead.html.inc" ?>
<p>The folks at Fastly said that to make the most of the Site Shield for Discourse, they recommended using Edge Site Includes…</p><p>Would it basically be a full rewrite to try and get ESI integrated with Fastly?</p><p>We have a site that gets significant traffic spikes (~500k users), so a solution like ESI sounds like it would be an efficient way to survive during those spikes…</p>
<? include "postfooterbuttons.html.inc" ?>
<? include "footer.html.inc" ?>
As a “Single-Page Application”, Discourse really doesn’t serve very many web pages. It mostly serves JSON responses like this. Notice how there isn’t very much boilerplate in the JSON document; how the headers and buttons aren’t in this JSON document; just actual data.
What SPAs do is almost the same thing as edge-side includes, except that instead of the “edge” being at the CDN, they do it even “edgier”; the inclusions are done in the browser itself.