[feat] Add Response caching

This commit is contained in:
Yankai
2023-02-07 17:35:54 +00:00
committed by GitHub
parent 00b89daa23
commit 66587ee0d1
15 changed files with 879 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Octokit.Caching;
using Octokit.Internal;
namespace Octokit
@@ -163,6 +164,21 @@ namespace Octokit
}
}
/// <summary>
/// Convenience property for setting response cache.
/// </summary>
/// <remarks>
/// Setting this property will wrap existing <see cref="IHttpClient"/> in <see cref="CachingHttpClient"/>.
/// </remarks>
public IResponseCache ResponseCache
{
set
{
Ensure.ArgumentNotNull(value, nameof(value));
Connection.ResponseCache = value;
}
}
/// <summary>
/// The base address of the GitHub API. This defaults to https://api.github.com,
/// but you can change it if needed (to talk to a GitHub:Enterprise server for instance).