The Cache component allows ATG products to serve content straight from an in-memory cache rather than recomputing the content each time. When used properly, the Cache component can help the performance of your site.

We chose to use the Cache component on the page that displays the whole bike categories, category_all_bikes.jsp. We recommend that you use the Cache component on a small number of popular pages. The pages you choose should have content that is not personalized, or, if it is personalized, it should not have many options. Most of the content on cateogry_all_bikes.jsp is the same for every person who looks at it.

Cache was used for the portion of the page that shows the title “Browse Whole Bikes” and the listing of the categories of bikes, with a link for each bike, a picture, and a description.

If ATG is rewriting URLs then the Cache component must disable itself unless it is told that there are no URLs in the content being cached. In this example, the Cache component is used on those sections of the page that include no URLs. We also used the key parameter because there are many possible values for the output parameter of this invocation of the Cache component. The following version is actually included in Pioneer Cycling.

Note: The “. . .” markers in the following code sample indicate a place where code has been removed to clarify the sample.

<span class=storebig>
   Browse <dsp:valueof param="element.displayName"/>
</span>

. . .

<dsp:droplet name="ForEach">
 <dsp:param name="array" param="element.childCategories"/>
 <dsp:param name="elementName" value="childCategory"/>
 <dsp:param name="indexName" value="CategoryIndex"/>

 <dsp:oparam name="outputStart">
  <table cellspacing=5 cellpadding=0 border=0>
 </dsp:oparam>

 <dsp:oparam name="outputEnd">
  </table>
 </dsp:oparam>

 <dsp:oparam name="output">

    <tr valign=top>
     <td>
     <dsp:droplet name="/atg/dynamo/droplet/IsNull">
      <dsp:param name="value" param="childCategory.thumbnailImage.url"/>
      <dsp:oparam name="false">
      <dsp:include page="../common/ItemLink.jsp" flush="true">
     <dsp:param name="Item" param="childCategory"/>
       <dsp:param name="Image" param="childCategory.thumbnailImage"/>
     <dsp:param name="DisplayText" value=""/>
     <dsp:param name="navAction" value="push"/>
      </dsp:include>
      </dsp:oparam>
     </dsp:droplet>

     </td>
     <td></td>

    <td>
     <!-- Display a link to the page which displays the Category: -->
    <dsp:include page="../common/ItemLink.jsp" flush="true">
     <dsp:param name="Item" param="childCategory"/>
     <dsp:param name="navAction" value="push"/>
    </dsp:include><br>

     <dsp:droplet name="/atg/dynamo/droplet/Cache">
      <dsp:param name="hasNoURLs" value="true"/>
      <dsp:param name="key" param="childCategory.repositoryId"/>
      <dsp:oparam name="output">
       <dsp:valueof param="childCategory.longDescription">
        No description.</dsp:valueof>
      </dsp:oparam>
     </dsp:droplet>
    </td>

 </tr>

   </dsp:oparam>

</dsp:droplet>
 
loading table of contents...