ctw / ctw-middleware-page-cache
This PSR-15 middleware provides full page caching for Mezzio applications.
1.0.15
2021-06-22 11:35 UTC
Requires
- php: ^7.4 || ^8.0
- ctw/ctw-middleware: ^1.0
- laminas/laminas-cache: ^2.10
- laminas/laminas-diactoros: ^2.5
- mezzio/mezzio-fastroute: ^3.1
- mezzio/mezzio-session: ^1.4
Requires (Dev)
- laminas/laminas-servicemanager: ^3.6
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^0.12
- phpstan/phpstan-strict-rules: ^0.12
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
- symfony/var-dumper: ^5.2
README
⚠️ This component is under heavy development. Do not (yet) use it in a production environment.
$ composer require ctw/ctw-middleware-page-cache
Intro
middlewares/utils provides utility classes for working with PSR-15.
Installation
Install the middleware using Composer:
$ composer require ctw/ctw-middleware-page-cache
Standalone Example
// standalone example
Example in Mezzio
The middleware has been extensively tested in Mezzio.
After using Composer to install, simply make the following changes to your application's configuration.
In config/config.php
:
$providers = [ // [..] \Ctw\Middleware\PageCacheMiddleware\ConfigProvider::class, // [..] ];
In config/pipeline.php
:
use Ctw\Middleware\PageCacheMiddleware\PageCacheMiddleware; use Mezzio\Application; use Mezzio\MiddlewareFactory; use Psr\Container\ContainerInterface; return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { // [..] $app->pipe(PageCacheMiddleware::class); // [..] };