protected function getContent() { $cache_key = sprintf('JWKFactory-Content-%s', hash('sha512', $this->url)); if (null !== $this->cache) { $item = $this->cache->getItem($cache_key); if (!$item->isHit()) { $content = $this->downloadContent(); $item->set($content); if (0 !== $this->ttl) { $item->expiresAfter($this->ttl); } $this->cache->save($item); return $content; } else { return $item->get(); } } return $this->downloadContent(); }