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
1
vote
1 answer

Can I accomplish this in Varnish?

I have a website that fetches news articles via RSS feeds from many different sites. The script adds those articles to a mysql db. I display 10 articles per page over many many pages to the viewers. Currently I am caching full pages and purging the…
1
vote
0 answers

Symfony 2.4 ESI bug? (Debian 7 + nginx + Varnish + PHP 5.4 / PHP 5.5: ESI doesn't work - surprising PHP behavior)

Basics I made a very simple test action: /** * @Route("/public/debug/varnish", name="debug_varnish") * @Template */ public function varnishAction() { return []; } {# varnish.html.twig #}

Layout


{{…
1
vote
1 answer

Is there a way to resolve ESI with Apache even if Varnish is disabled? Is there an Apache module?

We are migrating a big website to Varnish (putting Varnish in front of Apache), but we would like to use ESI tags even without Varnish (in local development setups, for example). Does exists an Apache module for that? I haven't found nothing useful…
apelliciari
  • 8,241
  • 9
  • 57
  • 92
1
vote
1 answer

Varnish ESI & Wordpress - simulate loading a post

Update: I've answered this myself. See below. I guess I'm asking for the equivalent of a set_the_id() function, if one existed. I'm using Wordpress with Varnish for performance, and I want to use an ESI (Edge Side Include) for the sidebar, so things…
William Turrell
  • 3,227
  • 7
  • 39
  • 57
1
vote
0 answers

Symfony2 esi cache forms not working

I get to the weird situation. I have up to date server files with local files. This "flash message with error" appears when this is not valid: if ($form->isValid() && $this->checkLastComment($commentRepository,$user,$status, $comment)) { I have two…
Lukas Lukac
  • 7,766
  • 10
  • 65
  • 75
1
vote
3 answers

Varnish authenticate a cached request

I have a private intranet style website, where everyone must login before seeing any content. Once they're logged in, every page is the same - so I want these pages cached in Varnish, but still with a quick user access check. So I was thinking to…
leon.nk
  • 437
  • 2
  • 6
  • 15
1
vote
1 answer

Varnish ESI must take difference src path?

One page with 5 esi:include, each src is one same path with different params like 'm.htm?p=1' & 'm.htm?p=2', but I used varnishlog and see only 1 esi request happended, so don't I use one same path in more than one esi:include tag?
Hesey
  • 4,957
  • 6
  • 31
  • 31
1
vote
1 answer

Security ESI issue with symfony2

I'm facing a security problem with ESI on Symfony2 (2.2) : Some ESI of my application don't require to be logged and are public, but other ESI required the user to be logged and have the role ROLE_USER, for example. The problem is that every guy can…
Sybio
  • 8,565
  • 3
  • 44
  • 53
1
vote
1 answer

Twig syntax error when enabling ESI in symfony 2.1.8

Ive attempted to add an ESI render with {'standalone': true} to one of my twig templates and am getting the TWIG syntax error of: Unexpected token "punctuation" of value "," ("end of statement block" expected) in…
1
vote
2 answers

Installing ESI on Mac osx or windows (for localhost testing)

Hope some server side gurus can answer this one or point me in the right direction. We use Akamai in our corporate website setting. And therefore there's extensive use of 'ESI' files. I have 'mamp' installed on my Mac osx with bitnami's package.…
PKHunter
  • 682
  • 2
  • 13
  • 28
1
vote
1 answer

How to call Wordpress snippets in external/independent PHP file (outside of Wordpress)

I'm trying to set up an independent PHP file which has the ability to use a shortcode of a plugin currently installed. This file is to be completely external from my current Wordpress installation. I'm doing this as the php file (and ultimately…
Paul Thomson
  • 105
  • 2
  • 11
1
vote
1 answer

Loging on a cached page in an ESI component redirects on /_internal/secure/.../none.html

I've just setup varnish and i've done some tests on port 8080 before switching in production. I've noticed that if i'm on a cached page : /** * @Cache(smaxage="10800") * @Route("/{_locale}/", name="homepage2", requirements={"_locale" = "en|fr"}) …
sf_tristanb
  • 8,725
  • 17
  • 74
  • 118
1
vote
1 answer

Symfony2 Selective ESI caching

i'm using the Liip Cache Control bundle to handle the caching in my project. By using this bundle you can configure the caching like this: liip_cache_control: rules: - { path: /admin, controls: { private: true}, vary: [Accept-Encoding]…
Daan Poron
  • 2,708
  • 5
  • 29
  • 33
1
vote
4 answers

Varnish not processing ESI includes

I'm trying to setup Varnish to process ESI includes on a local environment. I am running varnish in a virtual machine and the content is running on the host machine. I have two files "index.html" and "test.html". These are both stored in a folder…
cowls
  • 24,013
  • 8
  • 48
  • 78
0
votes
1 answer

Is it realistic to use a CDN with low traffic numbers?

I have an application that I'd like to host on a CDN with edge side includes, even though I have relatively low web traffic. Is this possible with the big name CDNs, like Akamai, or would they just tell me to get lost? And how much would it cost? …
Marvin K
  • 437
  • 1
  • 5
  • 11