code: def setCache(self, val = 1):
          
          # first clear the old cached values
          self.cacheConnections = []
          self.cacheLayers = []
          if val:
              for layer in self.layers:
                  if layer.active and not layer.frozen:
                      self.cacheLayers.append( layer )
              for connection in self.connections:
                  if connection.active and not connection.frozen:
                      self.cacheConnections.append( connection )
docs: Sets cache on (or updates), or turns off