Baseflow / Baseflow/flutter_cache_manager

issue with the stalePeriod config

Offen
#485 2 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Dart
Sterne
809
Forks
510
Ø Merge
6 Min.
Gemergte PRs (30 T.)
1

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reproducing the behavior with the shown CustomCacheManager class and its Config.stalePeriod value alongside cached_network_image. Trace how the cache manager is supplied to image loading and verify whether an image remains usable after the configured duration. Done means identifying the cause and making stalePeriod take effect, or documenting a confirmed limitation and required configuration.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
dart, flutter
Bereich
mobile-dev
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.