Baseflow / Baseflow/flutter_cached_network_image

How does stalePeriod work?

Open
#1,026 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.6k
Forks
731
Avg merge
3d 9h
Merged PRs (30d)
1

Description

I passed a `cacheManager` to the `CachedNetworkImage` widget we are using.

To test whether the image is deleted from the cache or not, I set the `stalePeriod` to 5 seconds. Like this:

```dart
CachedNetworkImage(
imageUrl: "myimagelink"
cacheManager: CustomCacheManager.instance,
),

// ...

class CustomCacheManager {
static const key = DefaultCacheManager.key;
static CacheManager instance = CacheManager(
Config(
key,
stalePeriod: const Duration(seconds: 5),
),
);
}
```

However, the cache manager is not working as expected. If an image is cached and then not used for 5 seconds, shouldn't it be automatically deleted from the cache? We believe it should work this way. Or do we need to delete it manually?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.