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

@ -17,9 +17,17 @@ class MapController extends BaseController
{
public function index(): string
{
$locale = service('request')
->getLocale();
$cacheName = "page_map_{$locale}";
$cacheName = implode(
'_',
array_filter([
'page',
'map',
service('request')
->getLocale(),
can_user_interact() ? 'authenticated' : null,
]),
);
if (! ($found = cache($cacheName))) {
$found = view('pages/map', [], [
'cache' => DECADE,