Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry-pick caching fix #8389

Merged
merged 2 commits into from
Jun 24, 2019
Merged

cherry-pick caching fix #8389

merged 2 commits into from
Jun 24, 2019

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Jun 24, 2019

No description provided.

Recent pricing changes introduced a `sku=` query parameter that changes with every map load. This defeats the browser's ability to cache these tiles. We're working around that by implementing our own caching with the new `Cache` api.

- skips caching tiles that expire soon
- only caches mapbox tiles (no 3rd party tiles, styles, etc because the browser should cache these fine)
- does not work in IE, Safari

Browser tests can be found in debug/cache_api.html

mapboxgl.clearStorage added to provide a way to clear the cache.
This was throwing errors in browsers that don't support the cache api
but wasn't previously noticed because it was not breaking anything.
@ansis ansis merged commit 389a425 into release-oolong Jun 24, 2019
@asheemmamoowala asheemmamoowala deleted the cherry-pick-cache-api branch January 8, 2020 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants