question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mapbox tiles don't load (caching)

See original GitHub issue

Description

Sites using mapbox don’t load tiles on reoccurring visits. This problem occurs only in Brave.

Steps to Reproduce

  1. Go to https://travelfeed.io/map - the tiles load
  2. Revisit a few days later - the tiles are blank, the network request to https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v7.json... returns 403 Forbidden (from ServiceWorker) and 403 Forbidden (from disk cache)

Actual result:

Tiles don’t load

Expected result:

Tiles load

Reproduces how often:

Easily reproduced

Brave version (brave://version info)

0.70.123 Chromium: 78.0.3904.97 (Official Build) (64-bit)

Version/Channel Information:

All Brave desktop versions seem to be affected

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? No
  • Is the issue reproducible on the latest version of Chrome? No

Miscellaneous Information:

Related issue https://github.com/mapbox/mapbox-gl-js/issues/8859

Brave mobile (android) is not affected

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
tiotdevcommented, Dec 19, 2019

When analysing the requests in Chrome vs Brave, I found that Brave spoofs the referrer for some requests, changing it to “api.mapbox.com”. Adding this to the whitelisted domains for my mapbox API key did the trick, but it means that I have to expose my API key to other domains than my own. This weird behaviour of Brave should be changed.

0reactions
ryanbrcommented, Jun 8, 2020

@tiotdev Would this patch https://github.com/brave/referrer-whitelist/pull/33 help here. No security issues, just all standard referrers through.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maps APIs Caching | Help - Mapbox docs
Learn how to work with caching in Mapbox's Maps APIs. ... data updates to cached tiles won't be visible for at least 12...
Read more >
Avoid cached vector tiles from Mapbox - Stack Overflow
I'm running into a problem with Mapbox-GL-JS where there are cached vector tiles in my browser, preventing recent changes being seen.
Read more >
Caching Maps and Vector Tile Layers: Best Practices - Esri
Differences between Raster Tiles and Vector Tiles ... Ask the device to take on the rendering load. • Vector ... You don't need...
Read more >
Can I avoid the offline tile cache limit (i.e., 6k) by self-hosting a ...
Our terms of service do not allow you or an end user to redistribute offline maps downloaded from Mapbox servers.
Read more >
MGLOfflineStorage Class Reference - Mapbox
Mapbox resources downloaded via this API are subject to separate Vector Tile and Raster Tile API pricing and are not included in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found