Skip to content

Commit 0fe6430

Browse files
committed
fix: introduce the template content type total count in the template cache key
1 parent 5104daf commit 0fe6430

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

EMS/client-helper-bundle/src/Helper/ContentType/ContentType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,9 @@ public function setLastPublishedValue(string $lastPublishedValue): void
7070
$this->lastPublished = $lastPublished;
7171
}
7272
}
73+
74+
public function getTotal(): int
75+
{
76+
return $this->total;
77+
}
7378
}

EMS/client-helper-bundle/src/Helper/Templating/TemplateBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ public function getCacheKey(Environment $environment, TemplateName $templateName
8080
$settings = $this->clientRequest->getSettings($environment);
8181
$contentType = $settings->getTemplateContentType($templateName->getContentType());
8282

83-
return \sprintf('twig_%s_%s_%d', $environment->getAlias(), $templateName->getSearchName(), $contentType->getLastPublished()->getTimestamp());
83+
return \sprintf('twig_%s_%s_%d_%d', $environment->getAlias(), $templateName->getSearchName(), $contentType->getLastPublished()->getTimestamp(), $contentType->getTotal());
8484
}
8585
}

0 commit comments

Comments
 (0)