Browse Source

Cache article content

imwald
Nuša Pukšič 8 months ago
parent
commit
46582a2cd0
  1. 4
      src/Controller/ArticleController.php

4
src/Controller/ArticleController.php

@ -109,10 +109,10 @@ class ArticleController extends AbstractController
$cacheKey = 'article_' . $article->getId(); $cacheKey = 'article_' . $article->getId();
$cacheItem = $articlesCache->getItem($cacheKey); $cacheItem = $articlesCache->getItem($cacheKey);
// if (!$cacheItem->isHit()) { if (!$cacheItem->isHit()) {
$cacheItem->set($converter->convertToHtml($article->getContent())); $cacheItem->set($converter->convertToHtml($article->getContent()));
$articlesCache->save($cacheItem); $articlesCache->save($cacheItem);
//} }
// // suggestions // // suggestions
// $suggestions = $repository->findBy(['pubkey' => $article->getPubkey()], ['createdAt' => 'DESC'], 3); // $suggestions = $repository->findBy(['pubkey' => $article->getPubkey()], ['createdAt' => 'DESC'], 3);

Loading…
Cancel
Save