Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zfegg/page-cache-middleware
Static pages cache(using psr6) for psr7 middleware stack / 静态页面缓存PSR7中间件
https://github.com/zfegg/page-cache-middleware
Last synced: about 2 months ago
JSON representation
Static pages cache(using psr6) for psr7 middleware stack / 静态页面缓存PSR7中间件
- Host: GitHub
- URL: https://github.com/zfegg/page-cache-middleware
- Owner: zfegg
- License: mit
- Created: 2016-09-02T06:42:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-02T08:20:46.000Z (over 8 years ago)
- Last Synced: 2024-04-19T23:43:04.728Z (9 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Pages cache psr7 middleware / 静态页缓存PSR7中间件
=================================================[![Build Status](https://travis-ci.org/zfegg/page-cache-middleware.png)](https://travis-ci.org/zfegg/page-cache-middleware)
[![Coverage Status](https://coveralls.io/repos/github/zfegg/page-cache-middleware/badge.svg?branch=master)](https://coveralls.io/github/zfegg/page-cache-middleware?branch=master)
[![Latest Stable Version](https://poser.pugx.org/zfegg/page-cache-middleware/v/stable.png)](https://packagist.org/packages/zfegg/page-cache-middleware)Cache using psr6.
缓存使用PSR6规范.常见实例用于缓存程序生成的json,html,xml等
## Installation / 安装
使用 Composer 安装
~~~
$ composer require zfegg/page-cache-middleware
~~~## Usage / 使用
~~~php
//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 范例](examples/)
## 有哪些实现了 PSR-6
* [symfony/cache](https://github.com/symfony/cache)
* [zendframework/zend-cache:dev-develop](https://github.com/zendframework/zend-cache/tree/develop)
* [www.php-cache.com](http://www.php-cache.com/en/latest/)More [see packagist PSR-6 providers](https://packagist.org/providers/psr/cache-implementation).