Tutorial: Configuring edge side caching using ESI
This tutorial teaches you how to configure Edge Side caching using Edge Side Include (ESI). After this tutorial, we will be able to cache full-pages and page fragments at the edge of the network.
Learning objectives
Cache on the edge is a simple and effective way to improve the performance of the system.
Edge Side Include (ESI) is a simple markup language you can use to define Web page components for dynamic assembly and delivery of Web applications at the edge of the Internet.
The WebSphere Application Server's dynacache has built-in functionality so that setting the EdgeCacheable property of a cache entry to true will allow it to be cached on the edge. This property takes care of the ESI for you, making edge caching easy with virtually no setup overhead.
Time required
Expect this tutorial to take about 20 minutes to complete.
Audience
This tutorial is intended for WebSphere Commerce Administrators who will be responsible for configuring Edge Side caching using Edge Side Include (ESI).
Prerequisites
Publish the consumer direct sample store.
You will also need a cachespec.xml that caches the TopCategoriesDisplay page and the eMarketingSpot fragment of the ConsumerDirect store .
Expected results
In this tutorial, you learned how to cache pages on the edge of the network using ESI caching. You learned techniques for both full page and fragment caching.
Lessons in this tutorial
- Enable Edge caching
This section is related to enabling edge caching.
- Cache full pages using ESI caching
To cache an entry using ESI, use the property EdgeCacheable. Be aware that this property implies the property of consume-subfragments.
- Cache fragments using ESI caching
WebSphere Commerce uses the model-view-controller (MVC) programming model, where calls to a controller servlet might include one or more child JSP files to construct the view. For the child JSP files to be edge cacheable, request these JSP files externally. WebSphere Commerce's JSPs use request attributes that are set by the controller servlet.To cache these JSP files on the edge. you need alternate URL support to provide an alternate controller servlet URL used to invoke the JSP file.