Alternate URL is a method for edge caching JavaServer Pages (JSP) files and servlet responses that you can not request externally. Dynamic cache provides support to recognize the presence of an Edge Side Include (ESI) processor and to generate ESI include tags and appropriate cache policies for edge fragments that can be cached. However, you must be able to externally request an edge fragment from the application server before it can be cached. In other words, if a user types the URL in their browser with the appropriate parameters and cookies for the fragment, WebSphere® Application Server must be able to return the content for that fragment.
One of the standard Java™ Platform, Enterprise Edition (Java EE) programming architectures is the model-view-controller (MVC) architecture, where a call to a controller servlet might include one or more child JSP files to construct the view. When using the MVC programming model, the child JSP files are edge cached only if you can request these JSP files externally, which is not usually the case. For example, if a child JSP file uses one or more request attributes that are determined and set by the controller servlet, you cannot cache that JSP file on the edge. You can use alternate URL support to overcome this limitation by providing an alternate controller servlet URL used to invoke the JSP file.
<cache-entry>
<class>servlet</class>
<name>/AltUrlTest2.jsp</name>
<property name="EdgeCacheable">true</property>
<property name="alternate_url">/alturlcontroller2</property>
<cache-id>
<timeout>600</timeout>
<priority>2</priority>
</cache-id>
</cache-entry>
In this information ...Related tasks
Related reference
| IBM Redbooks, demos, education, and more(Index) |