Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[ios] Feature/cachebykey #8041

Closed
wants to merge 2 commits into from
Closed

Conversation

wibge
Copy link

@wibge wibge commented Feb 13, 2017

Added an optional cachekey for tilesets. If present, it is used instead of the url template for caching in the database. This is useful when tile servers urls changed, but you still want the offline cache to work.

This happens often for tile servers that have the access key as part of the url. But we've also used it before when changing USGS topographic servers or aerial imagery servers to different providers.

You specify the cacheKey in the tilejson and via a MGLTileSourceOption

@mention-bot
Copy link

@wibge, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @1ec5 and @incanus to be potential reviewers.

@1ec5
Copy link
Contributor

1ec5 commented Feb 13, 2017

This happens often for tile servers that have the access key as part of the url.

Part of the motivation of #7485 was to generalize the handling of the Mapbox-specific access_token query parameter to work with other tile servers, so that you could keep an access key parameter out of the cache key – or indeed any parameter that should change without busting caches, such as a timestamp or campaign ID.

You specify the cacheKey in the tilejson and via a MGLTileSourceOption

The TileJSON format is defined in this specification. It might be more convenient to define this option as an inline option in the style JSON format, similar to tileSize. It would still require a change to the Mapbox Style Specification, but that wouldn’t be quite as big of a deal.

@1ec5 1ec5 added Core The cross-platform C++ core, aka mbgl iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS offline labels Feb 13, 2017
@jfirebaugh
Copy link
Contributor

Hi @wibge, thanks for the contribution. #8084 adds the ability to transform URLs prior to the request but after the URL is recorded for cache purposes. It was motivated by similar needs; will it address your use cases? I'd like to minimize the feature set around this if possible.

@wibge
Copy link
Author

wibge commented Feb 22, 2017

It looks like that will meet our needs for this. Thanks. I'll close this now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS offline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants