首頁 > 後端開發 > php教程 > PHP高级缓存系统:Cachearium

PHP高级缓存系统:Cachearium

WBOY
發布: 2016-06-23 13:34:51
原創
1310 人瀏覽過

Cachearium 是一个用于 PHP 应用的高级缓存框架,具有简单和快速的特点。

  • recursive cache system, all the nested russian dolls you ever wanted
  • easy to integrate with your existing classes
  • key based cache expiration, no more headaches to invalidate stuff
  • multiple dependencies
  • lifetime expiration, because stuff rots
  • low level cache storage access, when you want to go raw
  • lots of examples and tests ready to copy/paste
  • variable fragments for things that are almost the same but not quite
  • pluggable backend modules: RAM, Memcached, Filesystem and you can add your own
  • detailed logs for profiling and debugging, and also see what is cached live in your webpage

示例代码:

$data = 'xxxx'; // store$cache = CacheAbstract::factory('your backend');$cache->store($data, new CacheKey('Namespace', 'Subname')); // get it latertry {     $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.open-open.com/lib/view/home/1431394929966

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板