Edge side includes

from Wikipedia, the free encyclopedia

Edge Side Includes or ESI is a markup language for dynamically assembling website components and delivering them as a finished page. ESI is an approach to prevent or mitigate scaling problems that a web server gets from increasing traffic.

Modern Internet pages often consist of many components with different lifetimes. This presents caching systems with completely new tasks. The element of a page with the shortest lifespan determines how long it can be cached. If a dynamic element such as a message box is now integrated on a page with predominantly static content, it no longer makes sense to cache the page as a whole, as the messages are static at the time of caching for the life of the cached element. However, doing without caching would mean that all the content of the page would have to be reassembled each time it was accessed, which would affect the computing costs and delivery time of the page.

To solve this problem, a group of companies (including Akamai , BEA Systems , Oracle Corporation ) jointly developed the ESI specifications and submitted version 1.0 of the specification to the W3C for approval in August 2001. It is currently in the status of a W3C NOTE.

ESI is supported by some content delivery networks (e.g. Akamai ) and proxy servers (e.g. Varnish , Squid and Mongrel ). While most proxy servers often only implement part of the specification, Akamai has added features to the version they support.

How is ESI implemented?

ESI element tags are inserted into HTML or other text-based content during creation. The elements defined by this tag are not displayed directly, but rather interpreted by the ESI processor as commands for certain actions. The XML based ESI tags show the ESI agent which actions have to be carried out so that the page can be loaded completely. A simple example of an ESI element is an include tag that integrates external content into the page. An ESI include tag could look like this:

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

In this example, the ESI processor would try to call the source URL ( src); if this cannot be reached, the alternative URL ( alt) is used. If this also fails, the item is silently removed.

In connection with a proxy cache server, ESI offers various caching scenarios. It is conceivable, for example, that the files accessed are cached locally, thus accelerating the delivery of this content. Alternatively, the page that embeds the ESI tags can also be cached and only the content that is loaded via ESI is requested again each time it is called. This allows different caching times for the same website or different degrees of personalization.

Features

The ESI specification describes four main features, among others:

  • inclusion
  • variables
  • conditions
  • Error handling

In addition to the above-described insertion of page fragments via include , variables can be used in ESI statements that consist of certain HTTP headers ( Accept-Language , Host , Referer , User-Agent ), a transmitted cookie or a query string (URL parameter ) come. These variables are read-only and can be used in logical expressions to load content depending on certain conditions. Error handling is handled by the onerror attribute, which allows a reaction to the fact that the original source cannot be reached and uses an alternative URL instead of an HTTP status code such as 404 to load the element or to download it removed from the output (see example above) .

Alternatives

The main alternative to ESI is to merge the pages on the web server by e.g. B. Server side includes and many types of server side scripting , or by using the browser's client side scripting and techniques like Ajax .

Web links

Individual evidence

  1. a b c http://www.w3c.org
  2. W3 NOTE process . Retrieved July 6, 2015.
  3. Varnish ESI features . Retrieved March 29, 2012.
  4. EdgeSuite 5.0 ESI Extensions to the ESI 1.0 Specification (PDF, 38 kB) Retrieved on March 29, 2012.