Reliable.HttpClient.Caching
1.1.0
See the version list below for details.
dotnet add package Reliable.HttpClient.Caching --version 1.1.0
NuGet\Install-Package Reliable.HttpClient.Caching -Version 1.1.0
<PackageReference Include="Reliable.HttpClient.Caching" Version="1.1.0" />
<PackageVersion Include="Reliable.HttpClient.Caching" Version="1.1.0" />
<PackageReference Include="Reliable.HttpClient.Caching" />
paket add Reliable.HttpClient.Caching --version 1.1.0
#r "nuget: Reliable.HttpClient.Caching, 1.1.0"
#:package Reliable.HttpClient.Caching@1.1.0
#addin nuget:?package=Reliable.HttpClient.Caching&version=1.1.0
#tool nuget:?package=Reliable.HttpClient.Caching&version=1.1.0
Reliable.HttpClient.Caching
Intelligent HTTP response caching extension for Reliable.HttpClient with preset-based configuration and automatic memory management.
Installation
dotnet add package Reliable.HttpClient.Caching
Quick Start
// Zero configuration - just add resilience with caching
services.AddHttpClient<WeatherApiClient>()
.AddResilienceWithMediumTermCache<WeatherResponse>(); // 10 minutes cache
// Use anywhere
public class WeatherService(CachedHttpClient<WeatherResponse> client)
{
public async Task<WeatherResponse> GetWeatherAsync(string city) =>
await client.GetFromJsonAsync($"/weather?city={city}");
}
Why This Package?
- Zero Configuration – Works out of the box with sensible defaults
- Preset-Based Setup – 6 ready-made configurations for common scenarios
- Automatic Dependencies – No need to manually register
IMemoryCache - Combined APIs – Resilience + Caching in one method call
- Performance Optimized – Smart cache keys, configurable expiry, memory-efficient
Caching Approaches
This package provides two caching approaches:
🌐 Universal Caching
- Best for: Multiple response types in a single client
- Key class:
HttpClientWithCache - Use case: Flexible, multi-type scenarios
🎯 Generic Caching
- Best for: Type-safe caching for specific response types
- Key class:
CachedHttpClient<TResponse> - Use case: High-performance, type-safe scenarios
- 📚 See Generic Documentation →
🎯 Need help choosing? See our Choosing Guide
Ready-Made Presets
Choose from preset configurations for common scenarios:
// Short-term (1 minute) - frequently changing data
services.AddHttpClient<ApiClient>()
.AddShortTermCache<ApiResponse>();
// Medium-term (10 minutes) - moderately stable data
services.AddHttpClient<ApiClient>()
.AddMediumTermCache<ApiResponse>();
// Long-term (1 hour) - stable reference data
services.AddHttpClient<ApiClient>()
.AddLongTermCache<ApiResponse>();
Documentation
📖 Complete Documentation - Full caching guide with examples 🎯 Choosing Guide - Which approach to use when 📝 Examples - Real-world usage scenarios
License
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Caching.Memory (>= 9.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Http (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Options (>= 9.0.8)
- Reliable.HttpClient (>= 1.1.0)
-
net8.0
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Caching.Memory (>= 9.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Http (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Options (>= 9.0.8)
- Reliable.HttpClient (>= 1.1.0)
-
net9.0
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Caching.Memory (>= 9.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Http (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Options (>= 9.0.8)
- Reliable.HttpClient (>= 1.1.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Reliable.HttpClient.Caching:
| Package | Downloads |
|---|---|
|
Planfact.AmoCrm.Client
Идиоматичный и типобезопасный .NET-клиент для интеграции с amoCRM API v4. |
|
|
Planfact.KodySu.Client
Идиоматичный и типобезопасный клиент для API kody.su v2.1 (поиск информации по телефонным номерам) с поддержкой отказоустойчивых соединений и кеширования. |
GitHub repositories
This package is not used by any popular GitHub repositories.
🚀 v1.1.0 Release - Generic Caching Architecture!
✨ New Major Features:
• Generic Caching Namespace (Reliable.HttpClient.Caching.Generic)
• Type-safe CachedHttpClient<T> for specific response types
• Compile-time type safety with improved performance
• Separate namespace organization: Generic vs Universal caching approaches
• Enhanced extension methods with "Generic" prefixes for clear API distinction
🏗️ Architecture Improvements:
• Clear separation between Generic (type-safe) and Universal (multi-type) caching
• Namespace restructuring for better developer experience
• Comprehensive documentation and choosing guides
🔄 Backward Compatibility:
• All existing Universal caching APIs remain unchanged
• Existing code continues to work without modifications
• Migration path available for those wanting type-safe benefits
📖 Documentation:
• Complete architecture guide and decision framework
• Real-world examples and common scenarios
• Migration guidance for different use cases