From 6470f0598e5762ede6ad3e9bd67b89ca9075f4a4 Mon Sep 17 00:00:00 2001 From: Boon Yong Yang <55826849+boonyongyang@users.noreply.github.com> Date: Sat, 21 Nov 2026 11:13:44 +0800 Subject: [PATCH] docs: clarify when stale cache files are removed --- flutter_cache_manager/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flutter_cache_manager/README.md b/flutter_cache_manager/README.md index d0e2df3e..71486d68 100644 --- a/flutter_cache_manager/README.md +++ b/flutter_cache_manager/README.md @@ -108,10 +108,12 @@ Cache-Control headers the manager tries to update the file and store the new one The files can be removed by the cache manager or by the operating system. By default the files are stored in a cache folder, which is sometimes cleaned for example on Android with an app update. -The cache manager uses 2 variables to determine when to delete a file, the `maxNrOfCacheObjects` and the `stalePeriod`. -The cache knows when files have been used latest. When cleaning the cache (which happens continuously), the cache -deletes files when there are too many, ordered by last use, and when files just haven't been used for longer than -the stale period. +During cleanup, the cache manager uses `maxNrOfCacheObjects` to limit the number of cached files, +removing the least recently used files first when the cache is over capacity. It also removes files +that have been unused for longer than `stalePeriod`. + +Cache metadata lookups schedule cleanup. A file can stay in the cache after its `stalePeriod` +has elapsed, until a cleanup pass removes it. ## Breaking changes in v2