flutter_cache_manager icon indicating copy to clipboard operation
flutter_cache_manager copied to clipboard

issue with the stalePeriod config

Open secretmoo35 opened this issue 9 months ago • 2 comments

I’ve encountered an issue with the stalePeriod setting in our CustomCacheManager when using it with cached_network_image. I tried setting different values, such as 1 minute, 1 day, and 15 days, but it doesn’t seem to take effect.

Here’s the current implementation:


class CustomCacheManager {
  static const key = 'customCacheKey';
  static CacheManager instance = CacheManager(
    Config(
      key,
      stalePeriod: const Duration(days: 15),
    ),
  );
}

I expected the cache to expire based on the stalePeriod value, but the images are still being loaded from cache beyond the set duration. Are there any limitations or additional configurations required for cached_network_image to respect this setting?

Would appreciate any insights. Thanks!

cached_network_image: ^3.4.1 flutter_cache_manager: ^3.4.1 flutter: 3.29.2

secretmoo35 avatar Apr 03 '25 13:04 secretmoo35

facing the same issue

percy54321 avatar Apr 21 '25 11:04 percy54321

@secretmoo35 did you got any solution ?

glintpursuit avatar Jul 24 '25 14:07 glintpursuit