Posted on 2008/11/13 19:49
Filed Under Development/PHP

대부분의 경우 캐쉬 기능을 구현해야 하는 경우가 있지만 Zend Cache에서는 유연하면서도 간단하게 구현된다.


set_include_path('../libraries');
require_once '../libraries/Zend/Cache.php';
// 선택한 프론트엔드용의 옵션을 배열로 설정합니다 $frontendOptions = array(caching => true, lifetime => 10); $id = 'thePage'; $cache = Zend_Cache::factory('Output', 'File', $frontendOptions, array());
//$cache->remove($id); //캐쉬 삭제
if(!$cache->start($id)) {
echo '이것은 캐쉬됩니다.' . time() . '<BR>';
$cache->end();
}
echo '이곳은 외부로 캐쉬되지 않습니다.' . time();

결과
이것은 캐쉬됩니다.1226572238
이곳은 외부로 캐쉬되지 않습니다.1226573235

2008/11/13 19:49 2008/11/13 19:49

트랙백 주소 : http://www.takeone.pe.kr/trackback/207

Counter

· Total
: 361249
· Today
: 69
· Yesterday
: 89