mapbox / mapbox/mapbox-gl-js

Cache-defeating URL parameters aren't passed to sprite URLs

Open
#5,550 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle: good first issue
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: 0.41.0

### Steps to Trigger Behavior

1. Call mapboxgl.map({ ... style: 'mapbox://styles/user/abc123?update=1 } )
2. The style file is fetched from: api.mapbox.com/styles/v1/user/abc123.json?update=1&access_token=...

### Expected Behavior

1. The sprite file is fetched from api.mapbox.com/styles/v1/user/abc123/sprite@2x.json?update=1&access_token=...

### Actual Behavior

1. The sprite file is fetched from api.mapbox.com/styles/v1/user/abc123/sprite@2x.json?access_token=...

This means that when you update icons through the Studio interface, it often takes a long time before you can see them in your maps, because the files get cached along the way, and there's really no workaround.

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 at the mapboxgl.map style-loading entry point and trace how the style URL is turned into the sprite URL. Verify that query parameters such as update=1 are retained in the sprite request, and confirm the resulting request avoids stale cached sprite data.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.