Bitrix Site Manager

CPageCache::EndDataCache

CPageCache::EndDataCache()

The method EndDataCache outputs the buffered HTML and stores it in the cache file on disc.

Parameters


No parameters.

See Also

Example



<?
// create an object
$obCache = new CPageCache; 

// caching time - 30 minutes
$life_time = 30*60; 

// form the cache ID according to all parameters
// which may affect the resulting HTML
$cache_id = $ELEMENT_ID.$IBLOCK_TYPE.$USER->GetUserGroupString(); 

// initialize buffered output
if($obCache->StartDataCache($life_time, $cache_id, "/")):
    // obtain the information block element parameters from the database
    if($arIBlockElement = GetIBlockElement($ELEMENT_ID, $IBLOCK_TYPE)):
        echo "<pre>"; print_r($arIBlockElement); echo "</pre>";
    endif;
    // write the buffered result to the cache file on disc
    $obCache->EndDataCache(); 
endif;
?>