HTTP/2 in MapTiler Cloud versus Domain Sharding Technique
This article compares the domain sharding technique and HTTP/2 web performance techniques. The former being older and nowadays outdated and the latter being the widely-acknowledged optimal approach to increased web performance. MapTiler is using HTTP/2 to optimize the loading times of web maps and map tiles to their users. MapTiler is also using HTTP/2 in their MapTiler Cloud API.
What is Domain Sharding Technique
Browsers limit the number of active connections for each domain. To allow simultaneous downloads of items exceeding this limit, the domain sharding technique distributes content across multiple subdomains. When multiple domains are used to provide multiple resources, browsers can download multiple resources simultaneously, resulting in faster page loads and a better user experience.
The problem with the domain sharding technique from a performance perspective is the cost of additional DNS lookups for each domain and the overhead of establishing each TCP connection.
The initial response to an HTTP request is generally an HTML file with a list of additional resources such as JavaScript, CSS, images, and other media files that need to be downloaded. Since browsers limit the number of active connections per domain, provisioning all requested resources from a single domain can be slow because assets need to be downloaded sequentially. With the domain sharding technique, requested downloads are served from more than one domain, allowing the browser to simultaneously download the needed assets. However, multiple domains are an anti-pattern because DNS lookups slow down the initial retrieval.
HTTP2 supports an unlimited number of concurrent requests, making the domain-sharding technique a deprecated requirement when HTTP/2 is enabled.
What is HTTP/2
HTTP/2 is a major revision of the HTTP network protocol and the primary goals of HTTP/2 are to reduce latency by enabling full request and response multiplexing, to minimize protocol overhead through efficient compression of HTTP header fields, and to add support for request prioritization and server push.
HTTP/2 does not change the application semantics of HTTP in any way. All of the core concepts contained in HTTP 1.1, such as HTTP methods, status codes, URIs, and header fields, remain. Instead, HTTP/2 modifies the way data is formatted (framed) and transferred between client and server, both of which drive the entire process, and hides the complexities. As a result, all existing applications can be delivered without modification.
Conclusion
MapTiler constantly innovates to make sure our users get the fastest and most user-friendly maps in the market. Being able to deliver the maps fast and glitch-free in the browser is one of the key elements of the game. HTTP/2 and HTTPS are used instead of the outdated domain sharding technique to make our maps fast and secure in the web browser.
Useful links
Related guides
- Automatically created API key
- Check if MapLibre GL JS is supported
- Coordinates API
- Dataset upload - formats and limits
- Difference between 256x256, 512x512, and HiDPI/Retina rasterized tiles
- Exported Tiles Multiplier
- Generalization in maps
- How are the tile requests cached in web browser?
- How MapTiler map tiles are Generated and Delivered
- How to add Geocoding control to Maplibre GL JS map