PHP高級緩存系統:Cachearium

jopen 9年前發布 | 36K 次閱讀 緩存組件 Cachearium

Cachearium 是一個用于 PHP 應用的高級緩存框架,具有簡單和快速的特點。

示例代碼:

$data = 'xxxx';

// store
$cache = CacheAbstract::factory('your backend');
$cache->store($data, new CacheKey('Namespace', 'Subname'));

// get it later
try { 
    $data2 = $cache->get(new CacheKey('Namespace', 'Subname'));
    // $data2 == 'xxxx';
}
catch (NotCachedException($e)) {
    // handle not cached
}

// store new value with automatic invalidation
$data = 'yyy';
$cache->store($data, new CacheKey('Namespace', 'Subname'));

項目主頁:http://www.baiduhome.net/lib/view/home/1431394929966

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!