getCachedConfigOnly function

Future<CDNConfig?> getCachedConfigOnly()

Gets the current cached configuration without fetching from CDN Returns null if no valid cache exists

Usage:

final config = await getCachedConfigOnly();
if (config == null) {
  // No cache, fetch from CDN
  final freshConfig = await getConfig();
}

@returns Future<CDNConfig?> Cached configuration or null

Implementation

Future<CDNConfig?> getCachedConfigOnly() async {
  final isValid = await cdnConfigInstance.isCacheValid();
  if (!isValid) return null;

  return await cdnConfigInstance.getCachedConfig();
}