Skip to content

Commit 977dc58

Browse files
committed
add readme info for cache
1 parent 0694a49 commit 977dc58

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.markdown

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ $repositories = $client->api('user')->repositories('ornicar');
5858

5959
From `$client` object, you can access to all GitHub.
6060

61+
## Cache usage
62+
63+
```php
64+
<?php
65+
66+
// This file is generated by Composer
67+
require_once 'vendor/autoload.php';
68+
69+
$client = new Github\Client(new CachedHttpClient(new FilesystemCache('/tmp/github-api-cache')));
70+
```
71+
72+
Using cache, the client will get cached responses if resources haven't changed since last time,
73+
**without** reaching the `X-Rate-Limit` [imposed by github](http://developer.github.com/v3/#rate-limiting).
74+
75+
6176
## Documentation
6277

6378
See the `doc` directory for more detailed documentation.

0 commit comments

Comments
 (0)