ESI
Home Overview Endorsers Specification News
Search
Accelerating E-Business Applications

Technical Specification
ESI Language Specification
Edge Architecture Specification
ESI Invalidation Protocol
JESI Tag Library Specification

JESI Tag Library 1.0 Specification: Tags for Edge-Side Includes in JSP

Contributors:
Julie Basu, Ajay Desai, Ping Guo, Larry Jacobs, Xiang Liu, Cyril Scott, Mark Tsimelzon, Brian Watson, Alex Yiu
Version: 1.0
Status : First draft

Table of Contents:

Overview
Template Declaration
Content Invalidation
Page Personalization
The JESI 1.0 Tag Library
<jesi:template>
<jesi:include>
<jesi:fragment>
<jesi:codeblock>
<jesi:control>
<jesi:invalidate>
<jesi:personalization>


Goals

The purpose of this document is to describe the syntax and semantics of the JSP tags in the JESI 1.0 tag library.

Audience of this Document

We assume the readers of this document have the basic understanding of ESI Specification 1.0 and JavaServer Pages application and JavaServer Pages Tag Library.


Overview

JESI tags Simplify the following tasks associated with ESI use from JSPs

  • Template declaration - Page template and fragment definition
  • Content invalidation - Invalidation message generation to remove Page template and fragments from ESI processors
  • Page personalization - tagging pages with personalized content which can be executed in an ESI processor

Motivation for JESI Tags

The JESI tag library is intended to be the convenient JSP application-level interface to the ESI tags for web caching functionality. Its purpose is to facilitate the use of ESI tags within a JSP application.

While ESI tags can be directly used in JSPs and servlets, there are several reasons why a custom JSP tag library on top of ESI is useful for JSP developers:

  • Standard JSP framework: Although ESI is XML-based and looks similar to a custom JSP tag library, it is nevertheless a different kind of mark-up language. JSP developers and JSP IDE tools are used to dealing with the standard framework of JSP custom tag libraries. For example, the path references in a JSP page are either page-relative or application-relative. These URIs can be translated by the JESI tag library into absolute path references for ESI.
  • Short-cut syntax: The JESI tag library can simplify common tasks such as:
    • Specifying meta-data information, such as expiry time of page fragments, conveniently within the JESI tags.
    • Sending invalidation messages to purge URLs
    • Personalizing dynamic pages using cookie information
    The JESI tags can translate these tasks into appropriate calls, such as generating a HTTP request for invalidation, translating into the appropriate ESI tag in the generated page, setting the appropriate HTTP response header etc.
  • Convenient application-level configuration files: The JESI tag library can make use of application-level configuration files to specify deployment-time parameters and default settings for various options. The config file allows parameters such as the username and password for invalidation to be conveniently specified externally at deployment time, without requiring changes to the application code.
    It can also simplify the JSP code that must be written to utilize ESI functionality by specifying application-specific defaults.

How Does JESI Work?

The JESI tag library will be installed on the customer's application server. It could be either be pre-installed by the application server vendor, or be installed directly by the customer.

JESI is layered on top of the ESI framework. No changes to the ESI language syntax, semantics, or implementation are necessary.

Instead of using ESI tags such as <esi:include> directly, the JSP developer will be using the JESI tags such as <jesi:include>. The Java code implementing the library will be translating the JESI tags into corresponding ESI tags. Note that the translation may not always be a simple one-to-one mapping.

There will be a tag library jar file containing the JESI tag handler implementation and a TLD file that describes the JESI tags and attributes.

JESI 1.0 Proposal

There are two parts to the JESI 1.0 specification:

  • Mandatory JESI tags, which must be implemented by a JESI 1.0-compliant tag library
    • for a mandatory tag, there may be some implementation optional attributes. Some implementation may choose not to implement in this version. Please note that this concept is different from the usage optional, where developers choose to use a particular feature or not. Implementation-optional does imply usage-optional, but not vice versa. If an attribute is marked as just "optional" within this document without explicitly specifing "usage" or "implementation",  then it means the attribute is usage-optional.
  • Optional JESI tags, which may be implemented by a JESI 1.0-compliant tag library.

Template declaration

Usage Models

The JESI 1.0 specification supports two different models of page fragment caching, for

  • JESI-enabling new JSP pages
  • JESI-enabling existing JSP pages.

JESI-enabling New Web Pages

This model is recommended for applications that are being newly written. The JSP developer factors a page into independent JSP fragments, and indicates how these JSP fragments are to be assembled into an "aggregate" JSP.

In this model, there are two tags:

  • <jesi:include> - for declaring in templates where fragments shall be included in the ESI processor; this JSP tag generates <esi:include> tag (refer to [2]).
  • <jesi:control> - for declaring the attributes of templates and fragments; e.g., expiration; this JSP tag corresponding to the control-headers of edge architecture in [1]. This tag is implementation-optional. The usage of this tag is optional. Without this tag, default control-header properties will be still set in the HTTP headers

JESI-enabling Existing Web Pages

This model is recommended for applications that already exist and can be assembled from an ESI processor.  In this model an existing JSP is enhanced to identify the page's template and fragments.

In this model the following tags are used for demarcating the page

  • <jesi:template> - for declaring a template and its attributes: e.g. expiration
  • <jesi:fragment> - for declaring a fragment within a template
  • <jesi:include> - same as above
  • <jesi:param> - used within a <jesi:include> tag to specify additional parameters; this tag is implementation optional
  • <jesi:codeblock> - for declaring a code block to be executed during template generation ; this tag is implementation optional


Before providing the detailed syntax and semantics of these tags, we illustrate their use through some examples.


Example 1: Independent Page Fragments

Assume that a page welcome.jsp is made up of three independent fragments:

  • stocks.jsp, which provides financial information on stocks
  • weather.jsp, which shows the weather conditions
  • sales.jsp, which lists the special sales events of interest to the user.
The aggregate portal page welcome.jsp may be assembled from these three JSP fragments using just the <jesi:include> tag as follows:
 

<html>

 <body>

   <jesi:include page="stocks.jsp" flush="true" />

 <p> 

 <hr> 

   <jesi:include page="/weather.jsp" flush="true" />

 <p> 

 <hr> 

  <jesi:include page="../sales.jsp" flush="true" />

 </body> 

</html>
In this example, the expiration of both portal template page and individual fragments follows the default setting. Or, developers can optionally put <jesi:control> within the including template JSP or individual fragment JSP, such as, stocks.jsp. When this page (say, the URL of this page is "http://host:port/application1/dir2/dir3/welcome.jsp" is requested, the following template will be generated from Java layer:

<html>
 <body>
   <esi:include src="http://host:port/application1/dir2/dir3/stocks.jsp" />
 <p>
 <hr>
   <esi:include src="http://host:port/application1/weather.jsp" />
 <p>
 <hr>
  <esi:include src="http://host:port/application1/dir2/sales.jsp" />
 </body>
</html>

Based on this template, ESI processor will fill in the included fragment content from its cache. It will request individual fragments if the cache copy does not exist or is out of date.


Example 2: Page Fragments with Varying Template

In some cases, the layout of the aggregate page may not be fixed. It may pick up different fragments depending on the user profile or other request parameters. In this e-commerce website example, a cookie is used to represent the identity of a customer. If the cookie does not present, this URL will show a generic welcome page with general product recommendation. However, if the cookie presents, the server logic will retrieve a list of recommended products and their page URLs based on the customer profiling. The list of recommended products URL will be listed in the template by <jesi:include> which in turn generates  <esi:include> for any downstream ESI processor to process.

<%

  String customerId=CookieUtil.getCookieValue(request,"customerid");

  if (customerId==null) {

    // some unknown customer 

%>

    <jesi:include page="genericwelcome.jsp" />

<%

  }

  else {

    // a known customer; trying to retrieve recommended products from profiling

    String recommendedProductsDescPages[]=ProfileUtil.getRecommendedProductsDescURL(customerId);

    for (int i=0; i<recommendedProductsDescPages.length; i++) {

%>

    <jesi:include page="<%=recommendedProductsDescPages[i]%>" />

<%

    }

  }

%>

Example 3: Page Fragments with ParametersHere is the source of the main.jsp:

 <html>
 <jesi:control cache="no" />
 <jesi:include page="a.jsp?p1=v1" />
 <h3>hello ...</h3>
 <jesi:include page="b.jsp" />
 <h3>world ...</h3>
 <jesi:include page="c.jsp?p1=v2" copyparam="true" />
 </html>

In this example, the main.jsp has three fragments: a.jsp, b.jsp and c.jsp. c.jsp functions based on another HTTP parameter "p2" passed from main.jsp. This is taken care by setting the "copyparam" attribute to true. When main.jsp is requested through "http://host:port/application1/main.jsp?p2=abc", the following ESI tag will be generated for <jesi:include> of c.jsp:
<esi:include src="http://host:port/application1/c.jsp?p1=v2&p2=abc" />

Please note that copyparam should be used only in a non-cacheable template (see above <jesi:control> tag). Because, the actual src attribute will change from one request to another.


Example 4: Using <jesi:template> and <jesi:fragment>

Here is a main.jsp:

main.jsp
<jesi:template expiration="3600">
HTML #1
<% // some Java code got always executed Java-code-#1 %>
<jesi:fragment expiration="60">
JSP code block #1
</jesi:fragment>
HTML #2
<jesi:fragment>
JSP code block #2 using default expiration
</jesi:fragment>
HTML #3
<jesi:fragment expiration="600">
JSP code block #3
</jesi:fragment>
HTML #4
</jesi:template>


Content invalidation

The JESI tag library provides the following tag:

  • <jesi:invalidate>
for explicitly removing and/or expiring selected objects cached in an ESI processor.

Cached objects may need to be invalidated depending on external circumstances such as changes to the underlying data in SQL tables. It is also possible that the execution of one object (or page) invalidates other cached objects. 


Page Personalization

A common requirement of web applications is the inclusion of user-specific information in a web page. For example, a welcome page for an application may contain the user's name in a greeting message. This makes the web page necessarily dynamic and dependent on cookie or session information. Without special tags to indicate this dependency to the ESI processor, the web page cannot be shared by multiple user sessions.
 



 

The JESI 1.0 Tag Library

Template declaration

The <jesi:template> tag

ESI template declaration tag

Syntax

<jesi:template
     [expiration="value"]
     [maxRemovalDelay="value"]
     [cache={"yes", "no", "no-remote"}]
     [control="control_str"]
     [useRelativeURLs="true" | "false" ]
     [scheme="scheme_str"]
     [serverName="server_name_str"]
     [serverPort="server_port_str"]
     [servletPath="servlet_path_str"]
     [pathInfo="path_info_str"]
     [executeEntirePage="true" | "false"]
        >

Description

The template tag is used to declare an ESI template within an existing JSP.

The template tag must appear before all the JESI tags or any buffer flush, while the end tag must appear after all other JESI tags. If this tag happens more than once within one JSP, a JspTagException will be thrown.

The attributes of the template tag are used to specify the property of the template itself. e.g. whether the template itself is cacheable, and if so for how long.  The attributes are the same for the <jesi:control> tag. This template tag will set corresponding HTTP headers according to Edge Architecture Specification [1].

expiration an optional parameter, is the template's lifetime in seconds from insertion in the ESI processor. The default is never-expire.

maxRemovalDelay an optional parameter,  is the maximum time, in seconds, after the template's expiration that the ESI processor may store the template.The default is zero, that means immediate removal.

cache an optional attribute to specify whether the template is cachable: yes, no, or no-remote. The default  is yes.

control an optional attribute that allows users to specify the ESI control headers directly, not just expiration and cacheability

useRelativeURLs If this attribute is set to true, all generated <esi:include> tags will have relative URLs as the src attribute value. Otherwise, all generated URLs will be absolute. The default value of useRelativeURLs is false.

scheme This attribute sets the protocol specified in all URLs generated within the body of the <jesi:template> tag. If this attribute is not set, then the value of request.getScheme() is used. If an expression is used to set the attribute value, that expression must result in a string. NOTE: In the case of <jesi:include> tags, this value will only affect URLs that do not specify a protocol.

serverName This attribute sets the domain specified in all URLs generated within the body of the <jesi:template> tag. If this attribute is not set, then the value of request.getServerName() is used. If an expression is used to set the attribute value, that expression must result in a string. NOTE: In the case of <jesi:include> tags, this value will only affect relative URLs.

serverPort This attribute sets the port specified in all URLs generated within the body of the <jesi:template> tag. If the value of port ids the default port for the specified protocol, the port will not be explicitly set in the generated URLs. If this attribute is not set, then the value of request.getServerPort() is used. If an expression is used to set the attribute value, that expression must result in a string of a primitive integer.

servletPath an optional attribute that allows users to specify the servlet path explicitly; it is extra useful, when the request is under forwarding; it can be used to specify servlet path of the forwarding page.

pathInfo an optional attribute that allows users to specify the path info explicitly; it is extra useful, when the request is under forwarding; it can be used to specify path info of the forwarding page.

executeEntirePage an implementation optional boolean attribute, the default is false; if true, the whole page including the template and all the fragments will be executed.
 
Attribute Names Implementation Optional Usage Optional  Can be Request Time Attribute
expiration yes yes yes
maxRemovalDelay yes yes yes
cache yes yes yes
control no yes yes
useRelativeURLs yes yes no
scheme yes yes yes
serverPort yes yes yes
servletPath no yes yes
pathInfo no yes yes
executeEntirePage yes yes yes


The <jesi:include> tag

The include tag is used to identify JSPs for generating page fragments.

Syntax

<jesi:include
    page= "url_str" | "<%= expression %>"
    [flush="true"|"false"]
    [copyparam="true"|"false"]
    [alt="alt_page_str"]
    [ignoreError="true"|"false"]
       />

Or

<jesi:include
    page="url_str" | "<%=expression %>"
    [flush="true"|"false"]
    [copyparam="true"|"false"]
    [alt="alt_page_str"]
    [ignoreError="true"|"false"]
       >
    ( <jesi:param
        name="paramterName"
        value="{ parameterValue | <%= expression %> }"
        /> )+
</jesi:include>

 

Description

The <jesi:include> tag identifies a JSP page for generating the desired page fragment.  The tag is empty, except for an optional form where it includes parameters extracted from JSP include calls.

The main function of this tag is to generate <esi:include> tag embedded in the resulting template. It will generate only "src" attribute of the <esi:include> tag. It will not generate the "alt" and "onerror" attributes. It will generate the "src" attribute based on the given "page" attribute, "copyparam" and any enclosed <jesi:param> tags. The attributes of this tag resemble <jsp:include> to ease the migration from <jsp:include> to <jesi:include>. <jesi:include> is NOT intended to a perfect substitute of <jsp:include>. There are cases of which <jsp:include> cannot be substituted by <jesi:include>. For example, the including main page insert a Java object attribute into the HTTP servlet request object and passed to the included page.

page is a required attribute of the JSP page fragment, and can be specified either in the page-relative or application-relative format. It has the extra application root / context path processing. So, JSP developers do not need to hard code the deployment application path in this tag. (e.g. "http://host:port/publicapp/dir1/a.jsp" vs "http://host:port/betaapp/dir1/a.jsp".

flush is an optional attribute which is always ignored; the existence of this attribute make it easier for the existing <jsp:include> users to switch to <jesi:include>.

copyparam is an implementation-optional and usage-optional attribute; if the value is true, the "src" attribute of  generated ESI tag will be appended by the parameter string of the original HTTP request (not including HTTP posted parameter body). This attribute can be used only in a non-cacheable template page, since the original request parameters can change in each HTTP request. It should throw an JspTagException exception, otherwise. The default is false.

alt is an implementation-optional attribute that is used to generate the "alt" attribute in <esi:include>. The prepending logic for application path will be applied to this attribute, similar to the "page" attribute of this tag, if this "alt" attribute does not contain "http://" or "https://".

ignoreError is an implementation-optional boolean attribute. The default is false. If the attribute is true, under error conditions during ESI include, the ESI processor will continue with the rest of hte page. If the attribute is false, under error conditions during ESI include, the ESI processor raise an ESI exception.
 
 
Attribute Names Implementation Optional Usage Optional  Can be Request Time Attribute
page no no yes
flush no yes yes
copyparam yes yes no
alt yes yes yes
ignoreError yes yes yes

<jesi:param> is a tag enclosed inside the <jesi:include> tag; the <jesi:include> tag will insert the parameter name and parameter value as a form of HTTP query string after the given page attribute and before the query string from the original request. The insertion order is same as the <jesi:param> tag order. the <jesi:param> tag itself is implementation optional; however, the attributes are not implementation optional, once decided to be implemented.
 
Attribute Names Implementation Optional Usage Optional  Can be Request Time Attribute
name no no no
value no no yes


The <jesi:fragment> tag

Syntax

<jesi:fragment
     [expiration="value"]
     [maxRemovalDelay="value"]
     [cache="yes" | "no" | "no-remote"]
     [control="control_str"]
        >
    JSP code fragment
 </jesi:fragment>

Description

The <jesi:fragment> tag is used to demarcate a JSP code fragment within an existing JSP. When a specific fragment is requested (by specifying the esifrag query parameter in the request URL), only the content for that fragment is returned. This tag must be declared within the body of a <jesi:template> tag. This version of jesi:fragment does not support direct nesting within one page.

expiration an optional (both usage and implementation) parameter, is the template's lifetime in seconds from insertion in the ESI processor. The default is never-expire.

maxRemovalDelay an optional (both usage and implementation) parameter,  is the maximum time, in seconds, after the template's expiration that the ESI processor may store the template.The default is zero, that means immediate removal.

cache an optional (both usage and implementation) attribute to specify whether the template is cachable: yes, no, or no-remote. The default  is yes.

control a string attribute that sets the metadata for the fragment content. This value is set as the value of the ESI-control response header field. The header is set only if the specific fragment’s content is requested, not if the template content is requested.
 
 
Attribute Names Implementation Optional Usage Optional  Can be Request Time Attribute
expiration yes yes yes
maxRemovalDelay yes yes yes
cache yes yes yes
control no yes yes


The <jesi:codeblock> Tag


The <jesi:codeblock> tag controls the execution of ESI request dependant JSP code. This tag is implementation optional.

Syntax:

<jesi:codeblock execute="template" | "fragment" | "always" >
...Request Dependant JSP Content...
</jesi:codeblock>

Description:

Often, a JSP page will have some piece of code that needs to be executed before any other fragment is executed (a database connection needs to be established, user id computed, etc…). Sometimes the same piece of code also needs to be executed for the template, and sometimes it does not. The <jesi:codeblock> tag provides this level of control over the execution of the block. When implemented, this tag allows a user to control what type
of request will cause the body of the tag to be executed. This tag must be declared within the body of a <jesi:template> tag.
NOTE: It is assumed that the code within the body of the <jesi:codeblock> tag does not produce content that must be returned to the requestor. Any user visible content produced within the body of a <jesi:codeblock> tag is suppressed.

Attributes
execute The type of request that will cause the body of this tag to be executed. The following values have the specified behavior:

  • template: Only execute the tag body if the entire template is requested. If a specific fragment is requested, the body is not executed.
  • fragment: Only execute the tag body if one of the fragments was requested. If the entire template is requested, the body is not executed.
  • always: Always execute the tag body, regardless of the request type. This is the same behavior as not specifying the tag at all


The tag itself is implementation optional. However, the execute attribute is not, once decided to implement this tag.
 
Attribute Names Implementation Optional Usage Optional  Can be Request Time Attribute
execute no no no


The <jesi:control> Tag

The attributes of the control tag are used to specify ESI processor behavior of the object (template or fragment) e.g. whether the object is cacheable, and if so for how long.  The attributes are the same for the <jesi:template> tag. This tag is implementation optional.
 

Syntax

<jesi:control
     [expiration="value"]
     [maxRemovalDelay="value"]
     [cache= "yes" | "no" | "no-remote" ]
     [control="control_str"]
     [useRelativeURLs= "true" | "false" ]
     [scheme="scheme_str" ]
     [serverName="server_name_str"]
     [serverPort="server_port_str"]
     [servletPath="servlet_path_str"]
     [pathInfo="path_info_str"]
        />
 

Description

The control is an empty tag used to define how an ESI processor shall handle the object.  It may be used only once in any given JSP, and shall not be used in JSPs with a <jesi:template> tag. The control tag will set corresponding HTTP headers according to Edge Architecture Specification [1].

The control tag must appear before any other JESI tags and buffer flush. If the control tag happens more than once within one JSP, a JspTagException will be thrown.

expiration an optional attribute, is the object's lifetime in seconds from insertion in the ESI processor. The default is never-expire.

maxRemovalDelay an optional attribute, is the maximum time, in seconds, after the object's expiration that the ESI processor may store the object. The default is zero, that means immediate removal.

cache an optional attribute to specify whether the object is cachable: yes, no, or no-remote. The default  is yes.

control an optional attribute that allows users to specify the ESI control headers directly, not just expiration and cacheability

useRelativeURLs If this attribute is set to true, all generated <esi:include> tags will have relative URLs as the src attribute value. Otherwise, all generated URLs will be absolute. The default value of useRelativeURLs is false.

scheme This attribute sets the protocol specified in all URLs generated within the body of the <jesi:template> tag. If this attribute is not set, then the value of request.getScheme() is used. If an expression is used to set the attribute value, that expression must result in a string. NOTE: In the case of <jesi:include> tags, this value will only affect URLs that do not specify a protocol.

serverName This attribute sets the domain specified in all URLs generated within the body of the <jesi:template> tag. If this attribute is not set, then the value of request.getServerName() is used. If an expression is used to set the attribute value, that expression must result in a string. NOTE: In the case of <jesi:include> tags, this value will only affect relative URLs.

serverPort This attribute sets the port specified in all URLs generated within the body of the <jesi:template> tag. If the value of port ids the default port for the specified protocol, the port will not be explicitly set in the generated URLs. If this attribute is not set, then the value of request.getServerPort() is used. If an expression is used to set the attribute value, that expression must result in a string of a primitive integer.

servletPath an optional attribute that allows users to specify the servlet path explicitly; it is extra useful, when the request is under forwarding; it can be used to specify servlet path of the forwarding page.

pathInfo an optional attribute that allows users to specify the path info explicitly; it is extra useful, when the request is under forwarding; it can be used to specify path info of the forwarding page.
 
 
Attribute Names Implementation Optional Usage Optional  Can be Request Time Attribute
expiration yes yes yes
maxRemovalDelay yes yes yes
cache yes yes yes
control no yes yes
useRelativeURLs yes yes no
scheme yes yes yes
serverPort yes yes yes
servletPath no yes yes
pathInfo no yes yes


Content Invalidation

The <jesi:invalidate> tag

The <jesi:invalidate> tag provides the JSP programmer with an explicit way to remove and/or expire a specific object, or objects, cached in an ESI processor. This is an implementation optional tag.

Syntax  <jesi:invalidate
       [url="url" username="value"password="value"]
      <jesi:object uri="..."/>
  </jesi:invalidate>

Or  <jesi:invalidate
       [url="url" username="value" password="value"]
      <jesi:object uri="..." [prefix="yes"] [maxRemovalDelay="..."]>
          [<jesi:cookie name="..." value="..."/>]
          [<jesi:header name="..." value="..."/>]
      </object>
  </jesi:invalidate>

Description

In its simplest form, the <jesi:invalidate> tag is used to select a cached object based upon its (HTTP) URI.  In another form, all cached objects that share the same URI prefix may be selected.  In its general form, the tag selects an object based upon the conjunctive combinationof the following:

  • URI or URI prefix
  • A cookie name-value pair
  • A HTTP/1.1 request header
url, username, password, the URL, login username and login password for the cache server.  If omitted, the values must be specified in the JESI configuration file.
uri, the full (or prefix) URI of the page(s) to be invalidated.
prefix, qualifies uri: if "yes" its a prefix URI,else (the default) its a full URI.
maxRemovalDelay, the maximum period, in seconds, that the invalidated page(s) can be used for a cache hit. The default value is zero.
cookie, optional cookie value.
header, optional header value.

Examples

1. Invalidate a single object in the default ESI processor:

    <jesi:invalidate
        <jesi:object uri="/images/logo.gif"/>
    </jesi:invalidate>
  2. Invalidate all objects in the default ESI processor:
    <jesi:invalidate
        <jesi:object uri="/" prefix="yes"/>
    </jesi:invalidate>
  3. Invalidate a single object but allow it to be served stale for upto 30 mins:
    <jesi:invalidate
        <jesi:object uri="/images/logo.gif" maxRemovalDelay="1800"/>
    </jesi:invalidate>
  4. Invalidate a multi-version object:
    <jesi:invalidate
        <jesi:object uri="/page.htm">
          <jesi:cookie name="user_type" value="Customer"/>
        </object>
    </jesi:invalidate>



Page Personalization

The <jesi:personalization> Tag

This tag is used to easily enable a JSP for personalization in an ESI processor. For example, cookie value replacement in ESI processor, not in the original web server. It achieves this functionality by generating <esi:vars> tag. This tag is implementation optional.

Syntax

<jesi:personalize name="a_name_str" value="a_value_str" />

name a required attribute. It specifies the name of the cookie used to personalize the page by cookie value replacement.
value an usage-optional attribute. If it is not present, then no default value is generated in the <esi:vars> tag.

Example


<jesi:personalize name="user_id" value="Guest" />
This JESI tag will generate an ESI tag similar to this:
<esi:vars> $(HTTP_COOKIE{"user_id"}|"guest") </esi:vars>
which means ESI processor will try to retrieve the value of "user_id" cookie and do a value replacement in the ESI processor without sending a request back to the original server. If the user_id cookies cannot be found, the ESI processor may use the default value "guest" or go back to the original web server to get the cookie.

back to top

***

COPYRIGHT (C) 2001, ORACLE CORPORATION, AKAMAI TECHNOLOGIES, INC. ALL RIGHTS RESERVED. ORACLE AND AKAMAI PROVIDE THE INFORMATION ON THIS WEB SITE (THE "INFORMATION") FOR INFORMATIONAL PURPOSES ONLY, AND THE INFORMATION IS SUBJECT TO CHANGE WITHOUT NOTICE. NO LICENSES, EXPRESS OR IMPLIED, ARE GRANTED BY THE POSTING OF THE INFORMATION. YOU DO NOT ACQUIRE ANY RIGHTS, EXPRESS OR IMPLIED, TO THE INFORMATION, INCLUDING, WITHOUT LIMITATION, ANY RIGHT TO USE THE INFORMATION. ORACLE AND AKAMAI SHALL RETAIN ALL RIGHTS TO THE INFORMATION.

Home | Overview | Endorsers | Specification | News | Contact Us