ESI Examples from www.akamai.com

Example 1

The following esi code is used for the www.akamai.com search input box. The Netscape web browser sizes text input boxes differently from other browsers. This example is a browser detect that ajusts the size of the text input based upon which browser is being used so that the text size box is consistent across browsers.
<!--esi
<esi:choose>
<esi:when test="$(HTTP_USER_AGENT{browser})=='MOZILLA'">
<input type="text" name="criteria" size="7">
</esi:when>
<esi:otherwise>
<input type="text" name="criteria" size="14">
</esi:otherwise>
</esi:choose>
-->
<esi:remove>
<input type="text" name="criteria" size="7">
</esi:remove>

ESI Output:

Example 2

The following esi code is used for the customer testimonials on the www.akamai.com home page. The included file is a ColdFusion script that selects one of four graphics at random and displays them.
<esi:include src="http://www.akamai.com/cfcgi/quote_swap.dbm" ttl="5m"/>
<esi:remove>
<img src="/graphics/layout/quote1.jpg" width="144" height="193" border="0">
</esi:remove>


ESI Output: