Caching Http Backend for Octokit
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Octokit.Caching.Tests
Octokit.Caching
tools/nuget
.gitignore
LICENSE
Octokit.Caching.sln
Octokit.Caching.sln.DotSettings
README.md

README.md

Octokit.Caching

A decorator for Octokit.NET's IHttpClient that adds support for the caching of results and respecting etags.

Usage

There is an overload of the GitHubClient constructor that takes an IConnection. We use this to create a Connection where we inject our custom http client.

var connection = new Connection(
	new ProductHeaderValue("Ocotokit.Caching.Tests", "1.0.0"),
	GitHubClient.GitHubApiUrl,
	new InMemoryCredentialStore(new Credentials("token")),
	new CachingHttpClient(new HttpClientAdapter(), new NaiveInMemoryCache()),
	new SimpleJsonSerializer());

var client = new GitHubClient(connection);

CachingHttpClient takes an instance of ICache so you can injection your own custom caching behaviour.