typhoon/opcache
最新稳定版本:0.2.1
Composer 安装命令:
composer require typhoon/opcache
包简介
PSR-16 compliant cache that stores values as PHP files, suitable for OPcaching.
README 文档
README
PSR-16 compliant cache that stores values as PHP files, suitable for OPcaching.
Installation
composer require typhoon/opcache
Usage
use Typhoon\OPcache\TyphoonOPcache; $cache = new TyphoonOPcache('path/to/cache/dir'); $cache->set('key', $value); assert($cache->get('key') == $value);
How to configure default TTL
According to PSR-16:
If a calling library asks for an item to be saved but does not specify an expiration time, or specifies a null expiration time or TTL, an Implementing Library MAY use a configured default duration.
Here's how you can configure default TTL:
use Typhoon\OPcache\TyphoonOPcache; $cache = new TyphoonOPcache( directory: 'path/to/cache/dir', defaultTtl: new DateInterval('T1M'), );
How to delete stale cache items
use Typhoon\OPcache\TyphoonOPcache; $cache = new TyphoonOPcache('path/to/cache/dir'); $cache->prune();
统计信息
- 总下载量: 6.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-21