How to cache your page?

You create your page as any other pages. To cache your page, you just only add an attribute 'Cache' with value of 'true' for page xml element of your page configuration (*.pageconf file). For more custom cache, utilize two other attributes: CacheLifetime, and CacheKeys.

CacheLifetime attribute defines for how long time (in minutes), page cache is valid. CacheKeys attribute defines in what parameters (key), separate cache will be made for the same page. As for example, you have page to deliver user information that not change for a user but different from user to user, you can use user id for CacheKeys.

Here is for your example:



<?xml version="1.0" encoding="UTF-8"?>
<page name="HelpFile" id="HelpFile" Cache="true" CacheLifetime="0" CacheKeys="fn::GetParam('context_id')" >
<processor PageSecurityCode="Page|HelpFile" HelpContext="LIGHTARMY-Applications.HelpFile"
sOnlyTemplateFileName="HelpFile.html" CanPublic="true" Authenticate="false"
ValidateSystemConfiguration="false" >

<PageSecurityCode>
<Name>Help File</Name>
<Description></Description>
<HelpContext>LIGHTARMY-Applications.HelpFile</HelpContext>
</PageSecurityCode>

<TemplateProcessingScript><![CDATA[
CIISONLINE_HelpFile::HelpFile_Show();
]]></TemplateProcessingScript>

<ResponseProcessingScript><![CDATA[
CIISONLINE_HelpFile::HelpFile_Print();
]]></ResponseProcessingScript>

<IncludeFile>PageClass/HelpFile.php</IncludeFile>

</processor>
</page>

No comments:

Post a Comment

CommentLuv Enabled

Followers