consbio / mbtileserver

Basic Go server for mbtiles
ISC License
657 stars 104 forks source link

Add multiple subdomain support #153

Closed hyperknot closed 2 years ago

hyperknot commented 2 years ago

Traditionally raster maps were hosted from multiple subdomains, like tile1, tile2, tile3.domain.com, etc.

I guess with HTTP/2 this might be less important, but for example Mapbox still hosts from a.tiles.mapbox.com and b.tiles.mapbox.com, so still there must be some reason for doing it.

For example, this is how mapbox-streets-v8 looks like:

    "tiles":
    [
        "https://a.tiles.mapbox.com/v4/...",
        "https://b.tiles.mapbox.com/v4/..."
    ],

Please allow specifying domains to be used in the tiles key of the auto-generated services JSON.

Ideally it'd be something like this in an env var: SUBDOMAINS: "a.tiles.mapbox.com,b.tiles.mapbox.com"

hyperknot commented 2 years ago

OK, based on this article this technique is totally not needed or recommended since HTTP/2. Probably Mapbox uses it to support legacy clients or something similar.