Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Improve cache eviction strategy #9813

Closed
kkaefer opened this issue Aug 21, 2017 · 3 comments
Closed

Improve cache eviction strategy #9813

kkaefer opened this issue Aug 21, 2017 · 3 comments
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl feature offline

Comments

@kkaefer
Copy link
Member

kkaefer commented Aug 21, 2017

Our offline database cache currently evicts tiles based on a least recently used strategy. With an API like #2006 that would allow prefetching tiles along a path or at a destination, we'd need the ability to control cache eviction to prevent those unused tiles from getting evicted from the cache.

We should think about whether we can instead calculate a score based on multiple factors to decide whether we should remove something from the cache. Potential metrics that could go into the score are:

  • Last use date
  • Zoom level (favor lower zooms as they cover more area)
  • Distance from current position
  • Distance from specified prefetching path(s)

/cc @d-prukop

@kkaefer kkaefer added Core The cross-platform C++ core, aka mbgl feature offline labels Aug 21, 2017
@halset
Copy link
Contributor

halset commented Jun 25, 2018

Could it be an option to have different eviction strategies? As an start, the following two:

  • The current strategy.
  • A no evict strategy that basically has an empty evict method. The deleteRegion method will have to delete tiles exclusively to the deleted region, not just rely on the evict method. I do this in my app and it works well for such an offline heavy app.

@stale stale bot added the archived Archived because of inactivity label Dec 22, 2018
@stale
Copy link

stale bot commented Dec 22, 2018

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Dec 22, 2018
@kkaefer kkaefer reopened this Jan 2, 2019
@stale stale bot removed the archived Archived because of inactivity label Jan 2, 2019
@stale stale bot added the archived Archived because of inactivity label Jul 1, 2019
@stale
Copy link

stale bot commented Jul 1, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Jul 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl feature offline
Projects
None yet
Development

No branches or pull requests

2 participants