flutter_map_tile_caching icon indicating copy to clipboard operation
flutter_map_tile_caching copied to clipboard

[FEATURE] Provide manual trigger for clearing expired tiles

Open JaffaKetchup opened this issue 2 years ago • 3 comments

What do you want implemented?

cachedValidDuration allows for the automatic replacing of tiles when they become to old, in some browsing modes. However, it would be nice to be able to manually trigger a removal of all tiles that are older than a certain age.

This was originally requested by @eidolonFIRE in #119.

What other alternatives are available?

Pre-v6 it was possible to easily access the underlying IO storage. However, now that Isar is in use, this is much more difficult (although still possible).

Can you provide any other information?

No response

Severity

Annoying: Currently have to use workarounds

JaffaKetchup avatar May 06 '23 08:05 JaffaKetchup

I can offer some more context of why I am pruning the cache...

My app is using FMTC to cache ~7 different tile providers, with at least 4 of them running at the same time. As the app is used, quite a lot of cached data can accumulate. I have a manual Empty Cache button in my app settings, but that won't be discovered by most of my users. To avoid unnecessary bloat of the cache, when the app is started, I prune data that is ~2x its expiration date. This way, under heavy app usage, users won't hit an artificial limit and find the cached data gone when they get out of cell tower range, but all the data they do accumulate during the session will eventually be automatically cleaned up.

eidolonFIRE avatar May 06 '23 16:05 eidolonFIRE

Thanks @eidolonFIRE. I'm waiting for the first half of this week to pass, so that hopefully if there are any bugs, I can bundle a fix with #123. #123 is stable atm, so you can use that if you're ready.

JaffaKetchup avatar May 07 '23 19:05 JaffaKetchup

(@eidolonFIRE and others)

This feature is included in the new prerelease.

I'm pleased (and exhausted) to announce that the next (and hopefully final) prerelease is now available: https://pub.dev/packages/flutter_map_tile_caching/versions/9.0.0-dev.7. ObjectBox has finally arrived! A provisional CHANGELOG is available at https://pub.dev/packages/flutter_map_tile_caching/versions/9.0.0-dev.7/changelog#900---hundreds-of-hours---2024xxxx.

Some things to note:

  • #148
  • Importing functionality is not yet working
  • There is no gurantee for stability in this version: I have done basic testing only
  • There is little/no documentation available outside of what is in the code, including no migration info; I'll be happy to answer questions here, but some answers can be found in the CHANGELOG
  • No data from older versions will be available, but the databases will not be modified/deleted - check your storage space if necessary

I'm really eager to hear feedback. The number one thing I want to hear is that there are no(!?) crashes! But I also want to hear about bugs you've found. At this point, I cannot take further feature requests: I cannot afford the time to expand the scope of this further at the moment.

Please post feedback in #105.

JaffaKetchup avatar Mar 07 '24 21:03 JaffaKetchup