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

View File

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