cacheConfig method

Future<void> cacheConfig(
  1. CDNConfig config
)

Caches CDN configuration with current timestamp

Implementation

Future<void> cacheConfig(CDNConfig config) async {
  try {
    final configStr = jsonEncode(config.toJson());

    setValue(_configCacheKey, configStr);
    setValue(_configTimestampKey, DateTime.now().millisecondsSinceEpoch.toString());
  } catch (error) {
    // ignore: avoid_print
    print('Error caching CDN config: $error');
  }
}