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

Set basemap URL to tiles.basemaps.cartocdn.com #13458

Closed
jaakla opened this issue Jan 31, 2018 · 11 comments
Closed

Set basemap URL to tiles.basemaps.cartocdn.com #13458

jaakla opened this issue Jan 31, 2018 · 11 comments

Comments

@jaakla
Copy link

jaakla commented Jan 31, 2018

Change any basemap URLs in Builder configurations from *global.ssl.fastly.net to CDN-independent tiles.basemaps.cartocdn.com.

Required for CDN change (https://github.com/CartoDB/cartodb-management/issues/5093)

I would retire domain sharding (i.e. a-, b- etc subdomains), as most modern browsers will do HTTP/2 multiplexing anyway and sharding would just cost extra time due to DNS lookups.

Fixes also #13159 .

There should be no pre-requisites for this, can be done immediately.

Extra step: Existing map configurations should be rewritten - Something similar to update_nokia_layers in layers.rake as hinted by @javitonino.

@jaakla
Copy link
Author

jaakla commented Jan 31, 2018

@matallo is this somehow technically linked to #12845 ?

@jaakla
Copy link
Author

jaakla commented Jan 31, 2018

Suggested domain rewriting table for existing maps, note different domain for enterprise and free:

old new
cartobase-a.global.ssl.fastly.net enterprise-a.basemaps.cartocdn.com
cartobase-1.global.ssl.fastly.net enterprise-a.basemaps.cartocdn.com
cartobase-z.global.ssl.fastly.net enterprise-a.basemaps.cartocdn.com
cartobase-b.global.ssl.fastly.net enterprise-b.basemaps.cartocdn.com
cartobase-2.global.ssl.fastly.net enterprise-b.basemaps.cartocdn.com
cartobase-c.global.ssl.fastly.net enterprise-c.basemaps.cartocdn.com
cartobase-4.global.ssl.fastly.net enterprise-c.basemaps.cartocdn.com
cartobase-d.global.ssl.fastly.net enterprise-d.basemaps.cartocdn.com
cartobase-3.global.ssl.fastly.net enterprise-d.basemaps.cartocdn.com
cartodb-basemaps-a.global.ssl.fastly.net a.basemaps.cartocdn.com
cartodb-basemaps-b.global.ssl.fastly.net b.basemaps.cartocdn.com
cartodb-basemaps-c.global.ssl.fastly.net c.basemaps.cartocdn.com
cartodb-basemaps-d.global.ssl.fastly.net d.basemaps.cartocdn.com
cartodb-basemaps-1.global.ssl.fastly.net a.basemaps.cartocdn.com
cartodb-basemaps-4.global.ssl.fastly.net b.basemaps.cartocdn.com
cartodb-basemaps-3.global.ssl.fastly.net c.basemaps.cartocdn.com
cartodb-basemaps-2.global.ssl.fastly.net d.basemaps.cartocdn.com

@javitonino
Copy link
Contributor

Uhm, we really don't have a good system to differentiate FREE and ENTERPRISE. I mean, we could do it at layer creation time with some small patches to the code, but we don't have a good way to keep it in sync if the user upgrades/churns.

Is the different domain per account-type a requirement? If so, we should sit and think about it some more.

@jaakla
Copy link
Author

jaakla commented Jan 31, 2018

No, we don't need this. Probably we don't have basemap enterprise URLs or requirements anywhere in existing carto maps configs, or in Builder. Enterprise users in Builder/Engine terms are technically just free map users from basemap service point of view, as they do not pay extra for basemaps. Even if they do, then currently they technically use free maps. If they really want, then they can add their enterprise URL as 'custom basemap xyz url' in Builder, from the last 30 day log I found exactly one such map which has requested 2 tiles: https://team.carto.com/u/javi/builder/18eb6018-32a7-455c-b585-d60236b2ae2c/basemap , thats some test I guess.

These enterprise domain names URLs are from server log, and it seems that these are directly hardcoded in some user's apps. In this sense the replacement script does not probably need them.

@matallo
Copy link
Contributor

matallo commented Jan 31, 2018

@matallo is this somehow technically linked to #12845 ?

Indeed, as explained in #12845 (comment) it is one of the steps to have full retina support in our raster basemaps (but not a blocker one)

@elenatorro
Copy link
Contributor

While doing this issue #12845, we have seen that we have some links hardcoded that we are using to convert from HTTPS and HTTP. Please take this into account because maybe we have to make changes here.

https://github.com/CartoDB/cartodb.js/blob/v4/src/vis/layers-factory.js#L14-L21

var HTTPS_TO_HTTP = {
  'https://dnv9my2eseobd.cloudfront.net/': 'http://a.tiles.mapbox.com/',
  'https://maps.nlp.nokia.com/': 'http://maps.nlp.nokia.com/',
  'https://tile.stamen.com/': 'http://tile.stamen.com/',
  'https://{s}.maps.nlp.nokia.com/': 'http://{s}.maps.nlp.nokia.com/',
  'https://cartocdn_{s}.global.ssl.fastly.net/': 'http://{s}.api.cartocdn.com/',
  'https://cartodb-basemaps-{s}.global.ssl.fastly.net/': 'http://{s}.basemaps.cartocdn.com/'
};

@jaakla
Copy link
Author

jaakla commented Feb 1, 2018

The new correct http://{s}.basemaps.cartocdn.com supports both http and https, but I would prefer usage of https as default whenever possible. I don't know how this would really affect HTTPS_TO_HTTP, or how (and why) this works, maybe add something like
'https://{s}.basemaps.cartocdn.com/': 'http://{s}.basemaps.cartocdn.com/'?

@jaakla
Copy link
Author

jaakla commented Feb 2, 2018

cc @jorgesancha - this is something what is needed for CDN migration from CARTO, and in the other hand, it could be done already now. Can you make sure it is in the boards of respective team(s)?

@javitonino
Copy link
Contributor

cc @danicarrion @rochoa

@danicarrion
Copy link
Contributor

@javitonino please go ahead and add this to the backend kanban

@javitonino javitonino self-assigned this Mar 2, 2018
@javitonino javitonino mentioned this issue Mar 2, 2018
12 tasks
@javitonino
Copy link
Contributor

This is done for new maps. I'm creating https://github.com/CartoDB/cartodb-management/issues/5144 for the migration of existing maps.

@javitonino javitonino removed their assignment Mar 22, 2018
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

No branches or pull requests

5 participants