PHP code example of abouvier / slim-redis-cache

1. Go to this page and download the library: Download abouvier/slim-redis-cache 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/ */

    

abouvier / slim-redis-cache example snippets


$app = new \Slim\Slim();
// ...
$client = new \Predis\Client('tcp://localhost:6379', [
	'prefix' => $app->environment['SERVER_NAME']
]);
$app->add(new \Slim\Middleware\RedisCache($client, [
	'timeout' => 28800
]));
// ...
$app->run();