User Tools

Site Tools


en:public:developer:template_system:tags:string:datacache

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:public:developer:template_system:tags:string:datacache [2013/05/02 15:39]
svanderclock
en:public:developer:template_system:tags:string:datacache [2015/04/16 16:36] (current)
svanderclock [<#datacache>]
Line 1: Line 1:
 ====== <#datacache> ====== ====== <#datacache> ======
  
-Use this tag to cache data in memory.+Use this tag to cache data in memory. This is particularly usefull when part of the of the template  
 +is slow to construct and not change between each request. if you want to ignore the cache, you can  
 +use ak.no_datacache=1 in the http request params or in the cookie.
  
 ==== Parameters ==== ==== Parameters ====
Line 12: Line 14:
 ==== Literal ==== ==== Literal ====
  
-**<#datacache id=".." validity="...">**..content..**<#endsection>**+**<#datacache id=".." validity="...">**..content..**<#enddatacache>**
  
 ==== Example ==== ==== Example ====
Line 18: Line 20:
 <code html> <code html>
  
-<#datacache id="footer_POPULARAREAS_geoplaces|<#language>|<#Url_Transac_Kind default=0>|<#Url_Property_Subcategory default=0>" validity="604800"> +<#datacache id="MySlowFunctionResult" validity="604800"> 
-            <#{geoplaces>+ 
 +  <#ASlowFunction>
      
-              <#{GeoPlaceRequest.skip><#random Range=450><#}GeoPlaceRequest.skip> +<#enddatacache>
-               +
-              <#{GeoPlaceRequest.First>50<#}GeoPlaceRequest.First> +
-                 +
-              <#{GeoPlaceRequest.ID_indirect_parent_geoplace><#IF condition="<#language lowercase=1 checksum=1> <> 'usa'"><#language ISO3166=1><#endif><#}GeoPlaceRequest.ID_indirect_parent_geoplace> +
-   +
-              <#{GeoPlaceRequest.OrderBy> +
-                <#IF condition="<#Url_Transac_Kind default=0> = 5"> +
-                  nb_ad_newconstruction_DESC +
-                <#elseIF condition="<#Url_Transac_Kind default=0> = 4"> +
-                  nb_ad_equityrelease_DESC +
-                <#elseIF condition="<#Url_Transac_Kind default=0> = 2"> +
-                  <#IF condition="<#Url_Property_Subcategory default=0> = 2">   +
-                    nb_ad_com_forrent_DESC +
-                  <#else> +
-                    nb_ad_res_forrent_DESC +
-                  <#endif> +
-                <#elseIF condition="<#Url_Transac_Kind default=0> = 3"> +
-                  nb_ad_vacationrentals_DESC +
-                <#else> +
-                  <#IF condition="<#Url_Property_Subcategory default=0> = 2">   +
-                    nb_ad_com_forsale_DESC +
-                  <#else> +
-                    nb_ad_res_forsale_DESC +
-                  <#endif>                 +
-                <#endif>               +
-              <#}GeoPlaceRequest.OrderBy> +
-   +
-              <#{template> +
-                 +
-                <#if condition="<#Url_Transac_Kind checksum=1> = 0"><#_footer_POPULARAREAS_Transaction_type setValue="1"><#else><#_footer_POPULARAREAS_Transaction_type setValue="<#Url_Transac_Kind>"><#endif> +
-                <#if condition="<#Url_Property_SubCategory checksum=1> = 0"><#_footer_POPULARAREAS_Property_SubCategory setValue="1"><#else><#_footer_POPULARAREAS_Property_SubCategory setValue="<#Url_Property_SubCategory>"><#endif> +
-                                   +
-                <#for var="i" from="0" to="<#geoplaces.count> - 1"> +
-                  <a href="<#url id="PropertyListings" +
-                                 PropertyListings_Type="1" +
-                                 Output_Format="1" +
-                                 GeoPlace_ID="<#geoplaces[<#i>].id>" +
-                                 GeoPlace_URL="<#geoplaces[<#i>].Translations[<#language>].label_url>" +
-                                 GeoPlace_HaveChilds="<#geoplaces[<#i>].haveChilds>" +
-                                 PageNumber="1" +
-                                 Transac_Kind="<#_footer_POPULARAREAS_Transaction_type>" +
-                                 Property_Category="<#Url_Property_Category>" +
-                                 Property_SubCategory="<#_footer_POPULARAREAS_Property_SubCategory>" +
-                                 Property_Kind="<#Url_Property_Kind>" +
-                                 xmlencode="1">"><#geoplaces[<#i>].Translations[<#language>].label xmlencode=1></a><#if condition="(<#i> < <#geoplaces.count> - 1)">&nbsp;-<#endif> +
-                <#endfor> +
-   +
-              <#}template> +
-   +
-            <#}geoplaces>           +
-          <#enddatacache>+
                      
 </code> </code>
  
-The above example will output:  
- 
-<code html> 
- 
-<html> 
-  <head> 
-    This must be in the header 
-  </head> 
-  <body> 
-  </body>   
-</html> 
- 
-</code> 
  
en/public/developer/template_system/tags/string/datacache.1367494783.txt.gz · Last modified: 2013/05/02 15:39 by svanderclock