origo
origo copied to clipboard
Consolidate requests for WMS layers that uses the same source
Is your feature request related to a problem? Please describe. Origo sends one WMS request to the server for each layer and tile. If the map has many layers this will make map loading slow as the browser will only make six concurrent requests to the same server. This will result in the browser having to wait for requests to finish before a new request can be sent.
Describe the solution you'd like Origo should consolidate requests for WMS layers to the same server into one request. As this limits the possibility to overlay the layers in arbitrary order, the implementation must only consolidate requests for adjacent layers. Alternatively there must be a configuration that indicates which layers are grouped together in one request. In theory it should be faster to send fewer requests even when the same amount of data is processed as the impact of network latency is reduced when reducing the number of serial requests. Also the network transfer time would most likely be reduced as a composite image is likely to be smaller than the sum of individual images.
Another solution would be making composite layers able to toggle visibility on invividual layers. It could be accomplished by configuring a composite layer on the server and make origo discover which layers a composite layer contains and replace the request to a composite layer with a consolidated request for the visible layers. However, it puts som constraints on how the composite layer is published, which might not be universally supported and will probably make implementing toggling the visibility in the legend a nightmare.
Describe alternatives you've considered
- Investigate the possibility to move to HTTP/2, which would make the browser issue more concurrent requests, but that does not change the fact that there are many requests and would probably just choke the WMS server.
- Use composite layers, but that prevents the user from individually toggle visibilty for each layer.
- Increase the tile size. It helps to a certain point, but it won't change the number of layers.
- Add another DNS name pointing at the WMS server and distribute the layers between the server names.
Additional context Only implementation for WMS is considered. A similar feature could probably be implemented for AGS Map.