This commit is contained in:
f4ilji
2025-01-15 15:31:37 +05:00
parent 45e73e27a0
commit bad611eb84
27 changed files with 815 additions and 124 deletions
+2 -2
View File
@@ -22,13 +22,13 @@ use Inertia\Inertia;
class PageController extends Controller
{
public function render($path)
public function render(Request $request, $path)
{
// Генерируем уникальный ключ для кеширования
$cacheKey = 'page_' . md5($path);
// Пытаемся получить данные из кеша
$page = Cache::remember($cacheKey, now()->addHours(1), function () use ($path) {
$page = Cache::remember($cacheKey, now()->addHours(48), function () use ($path) {
return Page::where('path', '=', $path)
->with('section.pages.section', 'section.mainSection')
->first();