HttpCacheClient constructor
HttpCacheClient({
- required String baseUrl,
- Duration cacheTimeout = const Duration(minutes: 5),
- KeyGenerator? keyGenerator,
- Client? httpClient,
Creates a new HTTP client with caching support.
baseUrl: The base URL for all requestscacheTimeout: How long cached responses remain valid (default: 5 minutes)keyGenerator: Optional custom cache key generatorhttpClient: Optional custom HTTP client implementation
Implementation
HttpCacheClient(
{required this.baseUrl,
this.cacheTimeout = const Duration(minutes: 5),
KeyGenerator? keyGenerator,
http.Client? httpClient})
: _keyGenerator = keyGenerator ?? const DefaultKeyGenerator(),
_httpClient = httpClient ?? http.Client();