Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Prevent prefetching of surrounding images for WMS
For a true WMS it is not needed to prefetch surrounding tiles,
because:
- a WMS does not have fixed scales, so the re-using of cached images is
not very likely
- a WMS should always serve fresh data
- Creation of WMS images can be very resourcefull (on serverside) in
case of higher zoom levels or complex styling

IF prefetching is preferred, the service should show itself as WMTS or WMS-C

See #41691
  • Loading branch information
rduivenvoorde authored and nyalldawson committed Feb 25, 2021
1 parent fc8ac0e commit edf31db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -2010,9 +2010,10 @@ int QgsWmsProvider::capabilities() const
}
}

// Prevent prefetch of XYZ openstreetmap images
// See: https://github.com/qgis/QGIS/issues/34813
if ( !( mSettings.mTiled && mSettings.mXyz && dataSourceUri().contains( QStringLiteral( "openstreetmap.org" ) ) ) )
// Prevent prefetch of XYZ openstreetmap images, see: https://github.com/qgis/QGIS/issues/34813
// But also prevent prefetching if service is a true WMS (mSettings.mTiled = True)
// See https://github.com/qgis/QGIS/issues/34813
if ( mSettings.mTiled && !( mSettings.mXyz && dataSourceUri().contains( QStringLiteral( "openstreetmap.org" ) ) ) )
{
capability |= Capability::Prefetch;
}
Expand Down

0 comments on commit edf31db

Please sign in to comment.