[openstreetmap/openstreetmap-website] If http2 supported, disable tile domain sharding (#2584)
Guillaume Rischard
notifications at github.com
Thu Apr 9 18:29:48 UTC 2020
Domain sharding [is an http/2 antipattern](https://love2dev.com/blog/domain-sharding-http-2/). Browsers and servers are supposed to detect sharding, but that doesn't always happen, for example if a.tile and b.tile resolve to different IP addresses - and even then, it still takes a bit of extra effort.
This detects whether the client is connecting over http/2, and instructs it not to use four subdomains to load tiles.
If the browser supports http/2, use a.tile.openstreetmap.org instead of {switch:a,b,c,d}.tile.openstreetmap.org and gps-a.tile.openstreetmap.org/lines/{z}/{x}/{y}.png instead of https://gps-{s}.tile.openstreetmap.org/lines/{z}/{x}/{y}.png.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/2584
-- Commit Summary --
* If http2 supported, disable tile domain sharding
-- File Changes --
M vendor/assets/leaflet/leaflet.osm.js (26)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/2584.patch
https://github.com/openstreetmap/openstreetmap-website/pull/2584.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2584
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200409/dd9fb3ae/attachment.htm>
More information about the rails-dev
mailing list