Skip to content

Commit

Permalink
Fix caching keys
Browse files Browse the repository at this point in the history
  • Loading branch information
meezaan committed Sep 25, 2022
1 parent dee28a6 commit 98c4459
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/Controllers/v1/Edition.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function get(ServerRequestInterface $request, ResponseInterface $response
$format = Http\Request::getQueryParam($request,'format');
$language = Http\Request::getQueryParam($request,'language');

$result = $this->mc->get(md5('edition_' . $type . '_'. $format . '_' . $language),
$result = $this->mc->get(md5('edition_x_' . $type . '_'. $format . '_' . $language),
function (ItemInterface $item) use ($type, $format, $language) {
$item->expiresAfter(604800);
$e = new EditionResponse($this->em, null, $type, $language, $format);
Expand Down Expand Up @@ -63,7 +63,7 @@ public function getByType(ServerRequestInterface $request, ResponseInterface $re
{
$type = Http\Request::getAttribute($request, 'type');

$result = $this->mc->get(md5('edition_' . $type), function (ItemInterface $item) use ($type) {
$result = $this->mc->get(md5('edition_type_' . $type), function (ItemInterface $item) use ($type) {
$item->expiresAfter(604800);
$e = new EditionResponse($this->em,null, $type);

Expand Down Expand Up @@ -100,7 +100,7 @@ public function getByFormat(ServerRequestInterface $request, ResponseInterface $
$format = Http\Request::getAttribute($request, 'format');


$result = $this->mc->get(md5('edition_' . $format), function (ItemInterface $item) use ($format) {
$result = $this->mc->get(md5('edition_format_' . $format), function (ItemInterface $item) use ($format) {
$item->expiresAfter(604800);
$e = new EditionResponse($this->em,null, null, null, $format);

Expand Down Expand Up @@ -135,7 +135,7 @@ public function getByLanguage(ServerRequestInterface $request, ResponseInterface
{
$lang = $request->getAttribute('lang');

$result = $this->mc->get(md5('edition_' . $lang), function (ItemInterface $item) use ($lang) {
$result = $this->mc->get(md5('edition_lang_' . $lang), function (ItemInterface $item) use ($lang) {
$item->expiresAfter(604800);
$e = new EditionResponse($this->em,null, null, $lang);

Expand Down

0 comments on commit 98c4459

Please sign in to comment.