Lasso Soft Inc. > Home

[Cache_Object]

Caches the value of a named LDML variable. Uses the same parameters as the [Cache] ... [/Cache] tags, but requires a -Content parameter that specifies the name of an LDML object variable to be cached. This tag always returns the object value.

  • Syntax
  • Parameters
[Cache_Object: -Name='MyCache', -Content=$Object]
Required Parameters
-Content Specifies the the LDML variable to be cached.
-Name Specifies the name of the cache. The name of the cache identifies the cached contents so it can be referenced on several pages. This is the only required parameter.
Optional Parameters
-Expires Specifies how many seconds the cached contents should last. If the cached contents is older than the time interval specified, then new content values will be cached on the next page load.
-Condition Allows arbitrary refresh conditions to be specified. Accepts a boolean value of True or False and refreshes the contents immediately when True. Conditional expressions may be used to output the required True or False value. For example, -Condition=((Action_Param: 'Refresh') == 'Yes') refreshes the cache if the action param is equal to Yes.
-Session Specifies the name of a session that the cached content should be stored in. This allows the cached content to be user specific. If no -Session parameter is specified, then the content will be stored in a global variable instead.
-UseGlobal Can be used in concert with -Session to store cached data in both a global variable and a session. All caches are stored in a global variable by default if neither -Session or -UseGlobal is specified.
Examples

To cache an LDML object and return its value to the page:

Use the [Cache_Object] tag. The example below adds a variable named Data to the cache. Whenever the Data variable is called while the cache is not expired, any instance of the Data variable will be replaced with its cached value.

[Var:'Data'='This is some data']
[Cache_Object: -Name='Cache_Name', -Expires=3600, -Content=$Data]
Tag Link [Cache_Object] Category Utility
Type Substitution Data Source Any
Support Preferred Version 7.0
Output Type Any Security Tag
Implementation Sets Lasso 7.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft