[GIS] OpenLayers 3 with GeoWebCache – WMTS vs. WMS

geoservergeowebcacheopenlayerswmswmts

I am using OpenLayers 3 with GeoWebCache (GeoServer). Are there any performance differences between WMS and WMTS when using GeoWebCache?

I'm currently using url http://localhost:8080/geoserver/gwc/service/wms? and I would like to know if it will be faster to use WMTS instead

Best Answer

As long as OpenLayers is configured to make requests aligned to the grid, there should be no significant difference.

If your GeoWebCache instance is using FullWMS mode, then requests not aligned to the tile grid will be handled by merging, rescaling, and cropping tiles to fit the request which is significantly slower than using the tiles "as is". Without FullWMS mode, such requests will simply fail.

If you are using "Direct Integration" in GeoServer then requests made to GeoServer's WMS endpoint (geoserver/wms instead of geoserver/gwc/service/wms) will attempt to use GWC to handle the request and if that fails, it will render the image from scratch. So if you are using that endpoint and make requests not aligned to the grid, you will be bypassing the cache. If "Direct Integration" is off, then that endpoint will never use the tile cache.

While WMTS is not inherently faster than WMS, it does avoid the potential for these situations if you misconfigure OpenLayers. You would instead get errors or misaligned map layers, which ought to make it more obvious that you have a problem.