cacheResponse method
Future<void>
cacheResponse(
- String endpoint,
- LucidJsonMap response, {
- Duration? ttl,
- String? version,
Implementation
Future<void> cacheResponse(String endpoint, LucidJsonMap response, {Duration? ttl, String? version}) async {
final key = '$_prefix${endpoint.hashCode}${version != null ? '_$version' : ''}';
await _manager.putJson(key, {
'data': response,
'cachedAt': DateTime.now().toIso8601String(),
'endpoint': endpoint,
'version': version,
}, ttl: ttl ?? _defaultTtl);
}