Skip to content

Commit

Permalink
$cacheKey = urlencode($url);
Browse files Browse the repository at this point in the history
  • Loading branch information
artemsites committed Jun 1, 2024
1 parent 0333666 commit 24f3a4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function pageRoute(string $url, PageRepository $pageRepository, CacheInte
// !@note the match comes without the first slash, and in the database and cms the url with the first slash
$url = '/'.$url;

$cacheKey = $url;
$cacheKey = urlencode($url);

$pageContent = $pageCache->get($cacheKey, function (ItemInterface $item) use ($pageRepository, $url) {
$item->expiresAfter(365 * 24 * 60 * 60);
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/PageUpdateFromSheetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function pageUpdateFromSheet(Request $request, EntityManagerInterface $en
$entityManager->persist($page);
$entityManager->flush();

$cacheKey = $url;
$cacheKey = urlencode($url);
$pageCache->delete($cacheKey);

return new Response('success', Response::HTTP_OK);
Expand Down

0 comments on commit 24f3a4e

Please sign in to comment.