LayerGroupContainmentCache can incur in quite a performance penalty during startup, as it'll get all layer groups and the layers/groups they're linked to.
LayerGroupContainmentCache is a securtity subsystem aid only used by WMS.
This patch contributes a no-op implementation or a customized one depending on the value of the
geoserver.security.layergroup-containmentcache boolean config property, which is set to true in the default config's geoserver.yml for the wms, gwc, and webui services.
Additionally, the customized LayerGroupContainmentCache implementation avoids re-creating the cache multiple times during startup. The original implementation does it at the class constructor and on a ContextRefreshedEvent event.
Now, this event is triggered on any ApplicationContext refreshed, which for our spring boot services was being triggered three times: for the app context itself, the servlet context, and the actuator context.
Now we make sure the cache is built only when the root application context is refreshed.
LayerGroupContainmentCache
can incur in quite a performance penalty during startup, as it'll get all layer groups and the layers/groups they're linked to.LayerGroupContainmentCache
is a securtity subsystem aid only used by WMS.This patch contributes a no-op implementation or a customized one depending on the value of the
geoserver.security.layergroup-containmentcache
boolean config property, which is set totrue
in the default config'sgeoserver.yml
for thewms
,gwc
, andwebui
services.Additionally, the customized
LayerGroupContainmentCache
implementation avoids re-creating the cache multiple times during startup. The original implementation does it at the class constructor and on aContextRefreshedEvent
event. Now, this event is triggered on anyApplicationContext
refreshed, which for our spring boot services was being triggered three times: for the app context itself, the servlet context, and the actuator context.Now we make sure the cache is built only when the root application context is refreshed.