Skip to content

This PSR-15 middleware provides full page caching for Mezzio applications.

License

Notifications You must be signed in to change notification settings

jonathanmaron/ctw-middleware-pagecache

Repository files navigation

Package "ctw/ctw-middleware-pagecache"

Build Status Scrutinizer Code Quality Latest Stable Version

⚠️ This component is under heavy development. Do not (yet) use it in a production environment.

$ composer require ctw/ctw-middleware-pagecache

Intro

middlewares/utils provides utility classes for working with PSR-15.

Installation

Install the middleware using Composer:

$ composer require ctw/ctw-middleware-pagecache

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);
    // [..]
};

About

This PSR-15 middleware provides full page caching for Mezzio applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published