mapbox / mapbox/mapbox-gl-js

Configurable tile cache size

Open
#8,967 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Recently a tilecache has been added to Mapbox GL JS using Cache API (https://github.com/mapbox/mapbox-gl-js/pull/8363)

The size seems to be set at 50MB, but a larger cache would improve performance on machines with more storage available.
https://github.com/mapbox/mapbox-gl-js/blob/30db469efec189f100efa8ca15416f2127c267a0/src/util/tile_request_cache.js#L9

Can this be piped through to a property in mapboxgl.Map like:
new mapboxgl.Map({ cacheSize: 100*1024*1024 }) ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/util/tile_request_cache.js at the referenced size setting and trace how the tile cache is created when new mapboxgl.Map is initialized. Add support for the proposed cacheSize option and verify that the configured value controls the cache limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.