fix(cache): suffix cache names with authenticated for credits, map and pages

This commit is contained in:
Yassine Doghri 2022-01-23 19:00:08 +00:00
commit 418a70b2a6
13 changed files with 48 additions and 33 deletions

View file

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