File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,34 @@ add and/or remove slim site folders and files with any ftp client program in ```
226226
227227#### Database
228228
229- Database server name = database
229+ Database host = database
230+
231+ #### Redis
232+
233+ Redis cache middleware for Slim framework.
234+
235+ Example: Cache every successful HTTP response for 24 hours in the local Redis server.
236+
237+ ```
238+ use Slim\Factory\AppFactory;
239+
240+ require __DIR__ . '/../vendor/autoload.php';
241+
242+ $app = AppFactory::create();
243+
244+ //...
245+
246+ $client = new \Predis\Client('tcp://redis:6379', [
247+ 'prefix' => $request->getUri()->getHost()
248+ ]);
249+
250+ $app->add(new \RedisCache\Cache($client, [
251+ 'timeout' => 86400
252+ ]));
253+
254+ // ...
255+
256+ ```
230257
231258#### HTTP Caching
232259
You can’t perform that action at this time.
0 commit comments