bark / slim-redis-cache

Redis cache middleware for Slim framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RedisCache

Redis cache middleware for Slim framework.

Installation

composer require abouvier/slim-redis-cache

Usage

Cache every successful HTTP response for 8 hours in the local Redis server.

$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();

About

Redis cache middleware for Slim framework

License:Apache License 2.0


Languages

Language:PHP 100.0%