This commit is contained in:
SacredFloof committed 2026-03-13 01:22:28 +01:00
1 parent 695e4560b5
commit 86641919f8
27 files changed
+755 -344

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
namespace LeagueAPI;
public class HttpCache : Dictionary<string, string> { }
public static class CachingHttpClient
{
private static HttpCache _cache = ResourceService.GetHttpCache() ?? [];
private static HttpClient _client = new();
public static async Task<string> GetStringAsync(string requestUri)
{
if (_cache.TryGetValue(requestUri, out string? response))
{
return response;
}
return await _client.GetStringAsync(requestUri);
}
}