diff --git a/src/Controller/ArticleController.php b/src/Controller/ArticleController.php index c7f60a0..882df4c 100644 --- a/src/Controller/ArticleController.php +++ b/src/Controller/ArticleController.php @@ -97,14 +97,12 @@ class ArticleController extends AbstractController $article = $articles[0]; - $parsed = $converter->convertToHTML($article->getContent()); - -// $cacheKey = 'article_' . $article->getEventId(); -// $cacheItem = $articlesCache->getItem($cacheKey); -// if (!$cacheItem->isHit()) { -// $cacheItem->set($converter->convertToHTML($article->getContent())); -// $articlesCache->save($cacheItem); -// } + $cacheKey = 'article_' . $article->getEventId(); + $cacheItem = $articlesCache->getItem($cacheKey); + if (!$cacheItem->isHit()) { + $cacheItem->set($converter->convertToHTML($article->getContent())); + $articlesCache->save($cacheItem); + } $key = new Key(); $npub = $key->convertPublicKeyToBech32($article->getPubkey()); @@ -128,7 +126,7 @@ class ArticleController extends AbstractController 'article' => $article, 'author' => $author, 'npub' => $npub, - 'content' => $parsed, //$cacheItem->get(), + 'content' => $cacheItem->get(), 'canEdit' => $canEdit, 'canonical' => $canonical ]);