zfegg / page-cache-middleware
Static pages cache(using psr6) for psr7 middleware stack
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/zfegg/page-cache-middleware
Requires
- php: ^5.4 || ^7.0
- psr/cache: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- cache/array-adapter: ^0.4.2
- cache/filesystem-adapter: ^0.3.1
- phpunit/phpunit: ^5.5
- slim/http-cache: ^0.3.0
- slim/slim: ^3.5
- squizlabs/php_codesniffer: ^2.7
- zendframework/zend-diactoros: ^1.3
- zendframework/zend-stratigility: ^1.2
This package is not auto-updated.
Last update: 2025-10-12 01:34:28 UTC
README
Cache using psr6. 缓存使用PSR6规范.
常见实例用于缓存程序生成的json,html,xml等
Installation / 安装
使用 Composer 安装
$ composer require zfegg/page-cache-middleware
Usage / 使用
//Array cache $cacheData = []; $cacheItemPool = new ArrayCachePool(null, $cacheData); $middleware = new PageCacheMiddleware( $cacheItemPool, //PSR6 cache function ($key, $request) { //Rename cache item key. return md5($key); }, 60 //Page cache ttl. );
明细可参考写的 slimphp 范例