[QGIS-Developer] QGIS WMS provider firing too many requests !?

Richard Duivenvoorde rdmailings at duif.net
Fri Feb 26 01:35:38 PST 2021


On 2/25/21 11:48 PM, Nyall Dawson wrote:
> On Fri, 26 Feb 2021 at 05:25, Richard Duivenvoorde <rdmailings at duif.net> wrote:
>> Now I like to have some input indeed making prefetching behaviour more configurable:
>>
>> - where to put a checkbox/setting about prefetching tiles (global raster, or per wms service or just global, or a hidden setting)?
>> - what to make default (with or without prefetching...?)
>>
>> My first idea:
>> - add a checkbox "Prefetch surrounding WMS(T) images" in the WMS/WMTS Connection dialog in the 'WMS/WMTS Options' section; default FALSE (unless see below)
>> - In General Options / Network / Cache Settings add a  tab or just a checkbox with "Default prefetch WMS(T) images" (defaulting to FALSE, but if enabled the above mentioned checkbox will always be enabled too)
>> - also make this an option in the provider uri
> 
> Question: Do we REALLY need an option for this? I think the behavior
> after your recent PR is correct, in that we ALWAYS skip the prefetch
> for WMS. I don't think there's a strong enough use case that someone
> would want to enable this to warrant a new option (and the
> corresponding UI complexity and code maintainence burden that comes
> with a configurable option).

Hi Nyall, 

do you mean only WMS or do you mean all (tiled) services available in the qgswmsprovider.cpp?

So actually disable Capability::Prefetch for the wmsprovider?
https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmsprovider.cpp#L2018

Or were you only agreeing with WMS?

Because the real world cases are the ones like OpenStreetMap (who is already 'fixed' by Ale), but also in The Netherland where we have/had 'free' WMST services for Aerials and Topo (and several other services), but because of the super heavy load of these free services, they start to go away from the 'free' and want you to pay for a number of requests.
Besides this: (tile) resources do not come for free, they cost bandwidth/energy/computer power etc etc

As said, I haven't checked WMTS precisely (I did for WMS) but try:
https://geodata.nationaalgeoregister.nl/wmts?VERSION=1.0.0&request=GetCapabilities
and open the layer 'opentopo'.

For my mapcanvas of 1000x1000 pixels (theoretically 4x4=16 tiles of 256x256pixels, but say 6x6=36). 
If I zoom in I fire a >176 requests.
I would be Ok to have no prefetching at all for services, just to save the earth a little :-)

I agree that 'polluting' the interface with options is a good argument. An option then would be to make it a hidden/advanced setting, which I can disable (or others have to enable... how user/environmental friendly do we want to be).

Regards,

Richard Duivenvoorde


More information about the QGIS-Developer mailing list