IsCacheExpired
bool CPageCache::IsCacheExpired( string path )
The method checks if cache lifetime has expired. Generally, this method is used to delete cache files with expired lifetime. Non-static method.
Note. Cache file, created by the CPageCache class methods, has ".html" extension.
Parameters
Parameter | Description |
---|---|
path | Full path to file cache. |
See Also
Example
<? $path = $_SERVER["DOCUMENT_ROOT"]."/bitrix/cache/"; if($handle = @opendir($path)) { while(($file=readdir($handle))!==false) { if($file == "." || $file == "..") continue; if(!is_dir($path."/".$file)) { if(substr($file, -5)==".html") $expired = CPageCache::IsCacheExpired($path."/".$file); elseif(substr($file, -4)==".php") $expired = CPHPCache::IsCacheExpired($path."/".$file); } } } ?>
© «Bitrix24», 2001-2024