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

Improve cache eviction strategy #9813

Closed

Description

@kkaefer

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

Activity

  1. added
    Core
    on Aug 21, 2017
  2. halset commented on Jun 25, 2018

    @halset
    Contributor

    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.
  3. added
    archived
    on Dec 22, 2018
  4. stale commented on Dec 22, 2018

    @stale

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

  5. reopened this on Jan 2, 2019
  6. removed
    archived
    on Jan 2, 2019
  7. added
    archived
    on Jul 1, 2019
  8. stale commented on Jul 1, 2019

    @stale

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corearchivedfeatureoffline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions