abouvier / slim-redis-cache
Redis cache middleware for Slim framework
Installs: 2 007
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 3
Forks: 9
Open Issues: 0
Requires
- php: >=5.4.0
- predis/predis: ~1.0
- slim/slim: ~2.3
This package is auto-updated.
Last update: 2024-10-27 23:19:53 UTC
README
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();