fix(pages): add locale to page cache

This commit is contained in:
Yassine Doghri 2022-01-19 18:41:00 +00:00
parent 8721719cd7
commit 8f999ce2f7
1 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,9 @@ class PageController extends BaseController
public function index(): string
{
$cacheName = "page-{$this->page->slug}";
$locale = service('request')
->getLocale();
$cacheName = "page-{$this->page->slug}-{$locale}";
if (! ($found = cache($cacheName))) {
$data = [
'metatags' => get_page_metatags($this->page),