stc = GetTickCount(); // this element should always be dynamic request.element.isStatic = 0; // Check if any missing attributes missingAttr = getMissingAttributes(); pageIDControlID = '#request.page.id#_#request.element.id#';
Same Records Cache
Error: Missing custom script parameters: #Replace( missingAttr, ",", ", ", "ALL")#
// Create Memory Structures if they don't exist CreateMemStructures(attributes.elementType); // default cacheName to element Name if not specified if( NOT StructKeyExists(attributes,'CacheName') ) attributes.cacheName = attributes.elementName; // default forceRender to 0 if not specified if( NOT StructKeyExists(request.params,"ForceRender") ) request.params.ForceRender = 0; // Clear memory cache for this type of element is specified if( StructKeyExists(request.params,"ClearType") AND request.params.ClearType eq 1 ) { if( StructKeyExists( application.CS_SameRecordsCache, attributes.ElementType ) ) StructDelete( application.CS_SameRecordsCache, attributes.ElementType ); } // Clear memory cache for All types if specified if( StructKeyExists(request.params,"ClearAll") AND request.params.ClearAll eq 1 ) { if( StructKeyExists( application, 'CS_SameRecordsCache' ) ) StructDelete( application, 'CS_SameRecordsCache' ); }
Custom Element Records Cache: CacheName:#attributes.cacheName# [Clear Type]   Cache Duration: [#attributes.MinutesToCache# minutes]
bMakeCache = 1;
Expires: #application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].expires#
if( NOT StructKeyExists( application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName], '#pageIDControlID#' ) ) application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID] = StructNew(); if( NOT StructKeyExists( application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID], 'renderhandler' ) ) { if( StructKeyExists( attributes, 'renderHandler' ) ) application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID].renderhandler = attributes.renderhandler; else application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID].renderhandler = ''; if( StructKeyExists( attributes, 'classNames' ) ) application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID].classNames = attributes.classNames; else application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID].classNames = ''; }
Rendered from cache. Expires in #DateDiff( 's', now(), application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].expires)# seconds at #application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].expires#
Render Handler: #application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID].renderhandler#
ClassNames: #application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID].classNames#
classNames = 'zz '; if( structKeyExists( application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][PageIDControlID], 'ClassNames' ) ) { classNames = application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][PageIDControlID].classNames; if( Len(classNames) ) application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].ElementInfo.ClassNames = classNames; }
class='#classNames#'>

#GetTickcount() - xtc#ms to render element from cached data.
application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].hitCount = application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].hitCount + 1; application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].lastuse = now();

==== RENDERED ELEMENT ===
pushed = 0; // check if nested invocations, if so clone if( StructKeyExists(request,"CS_SameRecordsInfo") ) { pushed_CS_SameRecordsInfo = copyStruct(request.CS_SameRecordsInfo); pushed = 1; } request.CS_SameRecordsInfo = StructNew(); request.CS_SameRecordsInfo.elementInfo = ''; if( StructKeyExists( attributes,'renderhandler' ) ) request.CS_SameRecordsInfo.renderhandler = attributes.renderhandler; else request.CS_SameRecordsInfo.renderhandler = ''; request.CS_SameRecordsInfo.ClassNames = ''; tc = GetTickcount();
Element Execution Time: #GetTickcount() - tc# ms   renderHandler:#request.CS_SameRecordsInfo.renderhandler#   ClassNames:#request.CS_SameRecordsInfo.ClassNames#   Items: #arraylen(request.CS_SameRecordsInfo.elementInfo.elementdata.PropertyValues)#
if( isStruct(request.CS_SameRecordsInfo.elementInfo) AND request.CS_SameRecordsInfo.renderhandler neq '' ) { if( FindNoCase( 'loader.cfm', cgi.script_name ) eq 0 ) { if( NOT StructKeyExists( application.CS_SameRecordsCache, attributes.ElementType ) ) application.CS_SameRecordsCache[attributes.ElementType] = StructNew(); if( NOT StructKeyExists( application.CS_SameRecordsCache[attributes.ElementType], attributes.cacheName ) ) application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName] = StructNew(); application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].elementInfo = copyStruct(request.CS_SameRecordsInfo.elementInfo); application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID] = StructNew(); application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID].renderhandler = request.CS_SameRecordsInfo.renderHandler; application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName][pageIDControlID].classNames = request.CS_SameRecordsInfo.classNames; application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].hitCount = 0; application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].created = now(); application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].lastuse = now(); application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].minutesToCache = attributes.MinutesToCache; application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].expires = DateAdd( "n", attributes.MinutesToCache, now() ); if( cgi.QUERY_STRING neq '' ) { tmp = ReplaceNoCase( cgi.QUERY_STRING, "ForceRender=", "f_r=", "ALL" ); application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].pageurl = cgi.script_name & "?" & tmp; } else application.CS_SameRecordsCache[attributes.ElementType][attributes.cacheName].pageurl = cgi.script_name; } } // pop the pushed back off the stack if ( pushed ) request.CS_SameRecordsInfo = application.ADF.data.duplicateStruct(pushed_CS_SameRecordsInfo); var missingAttr = ''; if( NOT StructKeyExists(attributes,"ElementType") ) missingAttr = ListAppend(missingAttr,"ElementType"); if( NOT StructKeyExists(attributes,"ElementName") ) missingAttr = ListAppend(missingAttr,"ElementName"); if( NOT StructKeyExists(attributes,"MinutesToCache") ) missingAttr = ListAppend(missingAttr,"MinutesToCache"); if( NOT StructKeyExists(attributes,"ShowClearLink") ) attributes.ShowClearLink = 0; if( NOT StructKeyExists(attributes,"Debug") ) attributes.Debug = 0; // Create the base memory structure if it does not exist. if( NOT StructKeyExists(Application,"CS_SameRecordsCache") ) application.CS_SameRecordsCache = StructNew(); if( NOT StructKeyExists(Application.CS_SameRecordsCache, arguments.elementType) ) application.CS_SameRecordsCache[arguments.elementType] = StructNew(); return application.ADF.data.duplicateStruct(arguments.srcStruct);