Cache: setLayers now uses the internal setLayer method to add layers to the cache one by one.