PHPackages                             zfegg/page-cache-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. zfegg/page-cache-middleware

ActiveLibrary[Caching](/categories/caching)

zfegg/page-cache-middleware
===========================

Static pages cache(using psr6) for psr7 middleware stack

0.1.0(9y ago)013MITPHPPHP ^5.4 || ^7.0

Since Sep 2Pushed 9y ago2 watchersCompare

[ Source](https://github.com/zfegg/page-cache-middleware)[ Packagist](https://packagist.org/packages/zfegg/page-cache-middleware)[ RSS](/packages/zfegg-page-cache-middleware/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

Pages cache psr7 middleware / 静态页缓存PSR7中间件
==========================================

[](#pages-cache-psr7-middleware--静态页缓存psr7中间件)

[![Build Status](https://camo.githubusercontent.com/a35a73483564200b3299c2b6ab81e2aa4ceac058adb5b6f7464a92f1bb5eeb90/68747470733a2f2f7472617669732d63692e6f72672f7a666567672f706167652d63616368652d6d6964646c65776172652e706e67)](https://travis-ci.org/zfegg/page-cache-middleware)[![Coverage Status](https://camo.githubusercontent.com/a2c52196e4d09ddbd4a001ce768ea94fa193b5fddf2e15427a68ecbe60eda905/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a666567672f706167652d63616368652d6d6964646c65776172652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zfegg/page-cache-middleware?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/92ba4acc3a76087f877f6aa66d307f87691c8833a0f3fbb8b73be493b079351b/68747470733a2f2f706f7365722e707567782e6f72672f7a666567672f706167652d63616368652d6d6964646c65776172652f762f737461626c652e706e67)](https://packagist.org/packages/zfegg/page-cache-middleware)

Cache using psr6. 缓存使用PSR6规范.

常见实例用于缓存程序生成的json,html,xml等

Installation / 安装
-----------------

[](#installation--安装)

使用 Composer 安装

```
$ composer require zfegg/page-cache-middleware

```

Usage / 使用
----------

[](#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 范例](examples/)

有哪些实现了 PSR-6
------------

[](#有哪些实现了-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).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3539d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2050694?v=4)[Moln](/maintainers/Moln)[@Moln](https://github.com/Moln)

---

Top Contributors

[![Moln](https://avatars.githubusercontent.com/u/2050694?v=4)](https://github.com/Moln "Moln (1 commits)")

---

Tags

middlewarepagepsr7cachezfegg

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/zfegg-page-cache-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/zfegg-page-cache-middleware/health.svg)](https://phpackages.com/packages/zfegg-page-cache-middleware)
```

###  Alternatives

[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1076.9M130](/packages/laminas-laminas-cache)[infocyph/intermix

A Collection of useful PHP class functions.

136.4k1](/packages/infocyph-intermix)[abouvier/slim-redis-cache

Redis cache middleware for Slim framework

172.0k](/packages/abouvier-slim-redis-cache)[bnomei/kirby3-redis-cachedriver

Advanced Redis cache-driver with in-memory store, transactions and preloading

101.7k](/packages/bnomei-kirby3-redis-cachedriver)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
