Skip to content

Commit eb11d65

Browse files
committed
Update README.md
1 parent cba0049 commit eb11d65

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)