PHP code example of ctw / ctw-middleware-pagecache

1. Go to this page and download the library: Download ctw/ctw-middleware-pagecache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ctw / ctw-middleware-pagecache example snippets


// standalone example

$providers = [
    // [..]
    \Ctw\Middleware\PageCacheMiddleware\ConfigProvider::class,
    // [..]    
];

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