marcato15/slim-redis-cache

Redis cache middleware for Slim framework

Installs: 3 201

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 9

pkg:composer/marcato15/slim-redis-cache

0.2.0 2017-02-08 18:14 UTC

This package is not auto-updated.

Last update: 2025-11-09 02:27:59 UTC


README

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