Skip to content
Advertisement

Mapbox GL what does ?fresh=true do when loading a tileset?

Mapbox GL what does ?fresh=true do when loading a tileset? We are having trouble loading the map in a react page. Removing ?fresh=true sometimes breaks the page and other times fixes it. I’m wondering what it does because I can’t find anything on it online

Answer

From https://github.com/mapbox/mapbox-sdk-js/issues/364#issuecomment-617894314:

  1. Requests that use this param bypass Mapbox’s caching, and request times can therefore be quite a bit slower.

  2. Requests that use this param have a significantly lower rate limit than cached requests.

There are a few valid use-cases for fresh=true, for example, to preview a change in your app if you’re co-developing a style and an app at the same time, but it should never be used in production / high concurrency environments.

Advertisement