$WBCACHE - cache content

Availability
$WBCACHE is available for use with all WBSP commands.

Syntax
$WBCACHE{code|time|uniqueID}
$WBCACHE[code|time|uniqueID]

Parameters
code  - WhizBase code snippet that should be cached
time - period of validity of cached content
uniqueID - part of code that uniquely identifies the snippet (see example below)

Returns
Cached content if it is not expired (older than specified  time) or executed code if it is. 

Example

[FormFields]
WB_basename=biblio.mdb
wb_rcdset=publishers
WB_Command=Q
wb_showlogo=F
wb_order=name
<!--WB_BeginTemplate-->
<html>
<head>
<title>Publishers</title>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--WB_BeginDetail-->
<span style="font-family:Verdana;font-size:14px;font-weight:bold;color:#0066cc;">$wbf[Name]</span><br>
$wbcache[$wbsrq[titles.sr|PubID=$wbf[PubID]]|300|$wbf[PubID]]<br>
<!--WB_EndDetail-->
</body>
</html>

When opened for the first time, this script will run sub report titles.sr and generate cache for every record. During next 300 seconds, any request for this script will return cached content, instead of running sub report titles.sr. We used $wbf[PubID] as unique identifier for cached content, because WhizBase would return the same cached content for all records if we did not.