added caching of spatialdb and layers to SpatialPlugin