PHP code example of wyrihaximus / react-http-middleware-response-cache-session-cache-configuration
1. Go to this page and download the library: Download wyrihaximus/react-http-middleware-response-cache-session-cache-configuration 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/ */
wyrihaximus / react-http-middleware-response-cache-session-cache-configuration example snippets
$server = new Server([
/** Other middleware */
new SessionMiddleware('Floki'), // Note that the order here is important. The session middleware MUST attach the session before the ResponseCacheMiddleware
new ResponseCacheMiddleware(
new SessionCacheConfiguration(
new CacheConfiguration(
[
'/',
'/robots.txt',
'/favicon.ico',
'/cache/***', // Anything that starts with /cache/ in the path will be cached
'/api/???', // Anything that starts with /cache/ in the path will be cached (query is