Questions tagged [esi]

Edge Side Includes or ESI is a small markup language for edge level dynamic web content assembly. The purpose of ESI is to tackle the problem of web infrastructure scaling by inserting ESI include tags directly into cached HTML documents. A ESI processors analyses the document to support different caching mechanisms and times different parts of the document, allowing for increased personalisation of cached pages.

It is fairly common for websites to have generated content. It could be because of changing content like catalogs or forums, or because of personalization. This creates a problem for caching systems. To overcome this problem a group of companies (Akamai, Art Technology Group, BEA Systems, Circadence Corporation, Digital Island, Inc., Interwoven, Inc., Open Market, whose ESI-related technology is now owned by FatWire Software, Oracle Corporation and Vignette Corporation) developed the ESI specification and submitted it to the W3C for approval. The proposal editor was Mark Nottingham.

ESI Language Specification 1.0 was submitted to the World Wide Web Consortium (W3C) for approval in August 2001. The W3C has acknowledged receipt, but has not accepted the proposal.

ESI is implemented by some content delivery networks, such as Akamai, and by some caching proxy servers such as Varnish, Squid and Mongrel ESI, although many do not implement the complete specification. Akamai also adds additional features to the version they support.

How ESI is implemented

ESI element tags are inserted into HTML or other text based content during creation. Instead of being displayed to viewers, these ESI tags are directives that instruct an ESI processor to take some action. The XML based ESI tags indicate to the edge-side processing agent the action that needs to be taken to complete the page's assembly. One simple example of an ESI element is the include tag which is used to include content external to the page. An ESI include tag placed in-line within an HTML document would look like this:

<esi:include src="http://example.com/1.html" alt="http://bak.example.com/2.html" onerror="continue"/>

In this case the ESI processor would retrieve the src URL, or failing that the alt URL, or if that failed do nothing. The ESI system is usually a caching proxy server so it may have a local copy of these files which it can insert without going back to the server. Alternatively the whole page with the ESI tags may be cached, and only the ESI requests may be made to the origin server. This allows different caching times for different parts of the page, or different degrees of personalisation.

Features

There are four main features in ESI:

  • inclusion of page fragments, as illustrated above;
  • variables which can be set from cookies or HTTP headers and then used in other ESI statements or written into markup;
  • conditions so that different markup can be used based on variables, for example if a cookie is set or not;
  • error handling, so that a failover can be used if an origin server is unavailable.
112 questions
0
votes
1 answer

Varnish ESI breaks on html comments

I'm running a drupal site and implementing esi support. So far it went ok when I implemented the basic esi support on blocks like this: I am a not yet from esi block Now this worked…
Tadej Magajna
  • 2,765
  • 1
  • 25
  • 41
0
votes
1 answer

Symfony 6 ESI (Edge Side Includes) not caching

I'm trying to cache a mega-menu on my website, since it doesn't change often and is resource heavy to compute. The menu is already an embedded controller, I just want to change it to an ESI. I've put a timestamp on the embedded menu controller, but…
Jonathan Clark
  • 1,180
  • 1
  • 8
  • 26
0
votes
1 answer

Using esi includes in Nuxt 2

My goal: Glue Nuxt 3 rendered code inside my old application that is written in Nuxt 2. The glue will be Varnish and using the
Quer
  • 405
  • 7
  • 16
0
votes
0 answers

Nuxt 3 - mount nuxt app to a template file

Goal: Inject/render a Vue app instance within another template file so that we won't bother to change any code that is written in AngularJS eg. angular-js-app \ > app > views index.hbs > nuxt-3-app ... > src ... main.js ... …
Quer
  • 405
  • 7
  • 16
0
votes
0 answers

data-sly-include file having issues showing if parent file is under sling dynamic include (SDI) configuration

We have a sling-dynamic-include (SLI) applied for a component. Everything shows in the page, except in the middle section below. So this component is tested to work with Edge-side-Include (ESI), but apparently a data-sly-include entry seems not…
pvma
  • 403
  • 8
  • 14
0
votes
2 answers

How can I use ESI tag for html script including?

I'm trying to reduce the number of requests' connections of js scripts and one option is usage of esi tag. Like from: To: But now cdn is…
0
votes
0 answers

How to generate fragment url in controller

I looking for possible to generate fragment url without use twig in twig i can use {{ render_hinclude(controller(' {{ render_esi(controller(' i see twig extensions but all is not public , protected ... how to generate this path in controller ? I…
Developer
  • 2,731
  • 2
  • 41
  • 71
0
votes
0 answers

Symfony testing while having esi

I try to test my rendering some ESI cached block in my page. In dev environment the block is present. But when i launch test and try to assert the element the crawler does not find it. This is the element : {{…
0
votes
0 answers

Cloudflare ESI worker / TypeError: Body has already been used

I'm trying to use a CloudFlare worker to manage my backend ESI fragments but i get an error: Uncaught (in promise) TypeError: Body has already been used. It can only be used once. Use tee() first if you need to read it twice. Uncaught (in response)…
0
votes
1 answer

How to receive GET request from URL

I am used to SEND all sorts of requests to 'foreign' URLs or to my Website Server URL and receive responses and such. And thus, i am used to receive requests as well. BUT Only if it targets a PHP file like so : http://www.example.com/file.php In…
Bo. Ga.
  • 138
  • 1
  • 4
  • 12
0
votes
1 answer

Varnish 4 ESI: bereq.url doesn't read url inside ESI src tag

I use varnish 4, php-fpm 7, nginx, centos 7 My varnish.params: DAEMON_OPTS="-a :80 -T 127.0.0.1:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,1g -p…
Yoga Fishguts
  • 116
  • 1
  • 7
0
votes
0 answers

Varnish not processing ESI for Wordpress back end

Problem: It seems that Varnish (ver 3.0) is unable to process esi when the URL is called through Wordpress. Background : Idea is to cache article pages or for that matter any static page (of Wordpres site) for a longer duration, but for certain…
anup
  • 153
  • 7
0
votes
1 answer

Varnish symfony esi: tag remove, but no content

So my problem: I have a big symfony project 2.3, varnish 5. So I want to include some fragment by symfony function render_esi(). After all problem I want to understand why doesn't include any file, even simply test.php. The problem is it's not…
0
votes
0 answers

symfony3 ESI privateCache transformed to publicCache

I am using the symfony reverse proxy for cache. I have 2 privates caches. You can imagine it as a private online-shop: the list of items is my first private cache because of the needed authentification of the user. the component is my second private…
goto
  • 7,908
  • 10
  • 48
  • 58
0
votes
1 answer

ESI include on akamai setup

I have a static HTML site, stored within Akamai's NetStorage. I have been looking into ESI so that I can include content within other pages, e.g. include navigation.html on all pages. Akamai have produced some good documentation around the structure…
Jonathan
  • 15
  • 2