File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,4 +41,11 @@ This library comes with a pluggable connector to use different HTTP client imple
4141through ` HttpConnector ` . In particular, this means you can use [ OkHttp] ( http://square.github.io/okhttp/ ) ,
4242so we can make use of it's HTTP response cache.
4343Making a conditional request against the GitHub API and receiving a 304 response
44- [ does not count against the rate limit] ( http://developer.github.com/v3/#conditional-requests ) .
44+ [ does not count against the rate limit] ( http://developer.github.com/v3/#conditional-requests ) .
45+
46+ The following code shows an example of how to set up persistent cache on the disk:
47+
48+ Cache cache = new Cache(cacheDirectory, 10 * 1024 * 1024); // 10MB cache
49+ GitHub gitHub = GitHubBuilder.fromCredentials()
50+ .withConnector(new OkHttpConnector(new OkUrlFactory(new OkHttpClient().setCache(cache))))
51+ .build();
You can’t perform that action at this time.
0 commit comments