Proposal: Exclude basemaps from single WMS layer option #6351
+62
−66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Having local basemaps like Orthofotos in an Cloud-Optimized format (COG - JPEG tiles in a TIFF container) and setting the option "Load layers as single WMS" highly degrades rendering time of lizmap projects. Switching from "no basemap" or OSM to the DOP adds 2-3s of rendering time for the client.
Checking the qgis-server logs led me to the conclusion that the problem can not be here: rendering time for the DOP was well below 1s (300-500ms) so the high cost likely comes from converting the original JPEG to PNG (the format of the combined requests) - setting the file format of the DOP layer in the lizmap plugin to jpeg does not change anything, as the JPEG-based DOP is added to the WMS stack which is delivered in PNG.
I propose to always render basemaps as separate layers and exclude them from the single WMS layer stack to circumvent this problem and deliver DOP as JPEG and speed up rendering time by the factor 10 (300ms instead of ~3000).
I also updated tests accordingly.
I'm very open to other suggestions for this particular problem!
The as-is status/loading time:

Here the result of rendering times with the proposed solution:
