You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example uses the PSR6 cache pool [redis-adapter](https://github.com/php-cache/redis-adapter). See http://www.php-cache.com/ for alternatives.
5
+
6
+
```php
7
+
<?php
8
+
9
+
// This file is generated by Composer
10
+
require_once 'vendor/autoload.php';
11
+
12
+
use Cache\Adapter\Redis\RedisCachePool;
13
+
14
+
$client = new \Redis();
15
+
$client->connect('127.0.0.1', 6379);
16
+
// Create a PSR6 cache pool
17
+
$pool = new RedisCachePool($client);
18
+
19
+
$client = new \Github\Client();
20
+
$client->addCache($pool);
21
+
22
+
// Do some request
23
+
24
+
// Stop using cache
25
+
$client->removeCache();
26
+
```
27
+
28
+
Using cache, the client will get cached responses if resources haven't changed since last time,
29
+
**without** reaching the `X-Rate-Limit`[imposed by github](http://developer.github.com/v3/#rate-limiting).
0 commit comments