public function process() { // Use or not caching $cacheable = $this->getProperty('cache'); if ($cacheable) { $key = $this->getProperty('cache_prefix') . md5(__CLASS__ . json_encode($this->getProperties())); if ($cache = $this->modx->cacheManager->get($key)) { return $this->prepareResponse($cache); } } $result = parent::process(); if ($cacheable) { $this->modx->cacheManager->set($key, $result, $this->getProperty('cache_lifetime', 0)); } return $result; }