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
2
votes
1 answer

nginx SSI module; disable file include?

I am looking at the NGINX SSI module and I am wondering if there is a way to block the "file" option on SSI. http://nginx.org/en/docs/http/ngx_http_ssi_module.html So that someone does not do this I wasn't able…
Daniel
  • 7,006
  • 7
  • 43
  • 49
2
votes
1 answer

Is it good practice to put Edge Side Includes into my templates?

In our Symfony2 Application we render reusable blocks with render_esi. We have this kind of templates: {% for products as product %}

{{ product.name }}

{{…
Maximilian Ruta
  • 518
  • 7
  • 18
2
votes
2 answers

Why is Varnish caching ESI fragments (when I tell it not to)?

II'm running into a peculiar problem with Varnish ESI. Each page on my site has a ESI fragment that spits out the (logged-in) user's account information. It looks like Varnish is returning the cached result of a user session ESI fragment unless…
2
votes
4 answers

Simulating ESI's when working on localhost

I've started using ESI's in Akamai. They work perfectly fine when I've got a site running on int/test/stage/production environments which actually run through Akamai. However, when we work locally on a PC, we tend to just use a simple jetty…
Bruce Lowe
  • 6,063
  • 1
  • 36
  • 47
2
votes
0 answers

plone diazo with esi

Is that possible to avoid having the doctype, , , added to a page when it is rendered with diazo? My problem is that when varnish is loading content from an tag, diazo adds the
2
votes
1 answer

Varnish and ESI HTTP AUTH

I'm very lost on this problem, and I don't know where could be the problem, so, I hope that you could help me. I have an HTTP BASIC authentification with symfony, and I'm trying to reach an url which is protected by this auth, with an tag in a…
Peekmo
  • 2,843
  • 2
  • 19
  • 25
2
votes
1 answer

Silex Esi cache for forms with CRSF

Silex offers the ability to automatically use CRSF protection for forms. The problem is that when using the provided HttpCacheProvider cache is impossible not to cache the token generated, so the solution is to use esi, but I can't make it work. I…
2
votes
0 answers

Randomly missing ESI content on tablet and mobile devices using Symfony2 and varnish

I have a weird issue where some content included via Edge Side Include is randomly missing. Its a menu wrapped in a header tag. Sometimes it displays in the browser sometimes its missing. A few notes: 1) This only happens on mobile and tablet…
BNK
  • 91
  • 2
  • 6
2
votes
1 answer

Edge Side Includes (ESI) are anything like Facebook's BigPipe?

Everyone interested in web application performance knows about the idea behind Facebook's BigPipe. Recently, Symfony released a new feature, called the fragments sub-framework. The idea behing this feature is to use the ESI technology, described to…
Daniel Ribeiro
  • 10,156
  • 12
  • 47
  • 79
2
votes
1 answer

Symfony2.2 render ESI template

From the documentation, there is no example of how to render a template inside template using ESI. Is it possible to do that? For example, I have a template index.html.php and I want to render form.html.php template with ESI. How to do that?
werd
  • 648
  • 4
  • 13
  • 23
2
votes
3 answers

Varnish ESI: strange characters

I'm having a problem with Varnish ESI (Edge Side Includes): sometimes the part which uses ESI displays strange characters, like the ones of image below: How can I fix this? The funny part is that sometimes this problem occurs, but sometimes not.
2
votes
3 answers

Can Varnish ESI script get the page that was on (origin page)?

I have a PHP page that I cache with Varnish: http://categories.php?name=NAME. It has some ESI scripts like : < esi:include src="/esi.php" / > All the pages have similar header, footer, sidebars so I remove the name=NAME when doing the VCL hash so…
vladady
  • 21
  • 3
2
votes
5 answers

Most secure javascript JSON Inline technique

I'm using varnish+esi to return external json content from a RESTFul API. This technique allows me to manage request and refresh data without using webserver resources for each request. e.g: ....