Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 457 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 457 Bytes

RedisCache

Redis cache middleware for Slim framework.

Installation

composer require marcato15/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();