CacheariumPHP 缓存框架

联合创作 · 2023-09-29 06:05

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'));

Cachearium cache debug probes

浏览 5
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报