From 4f37e4a3904dc8563cd4d5abaf5caabe2c66f0d1 Mon Sep 17 00:00:00 2001 From: zebardy Date: Thu, 21 Nov 2019 18:51:04 +0000 Subject: [PATCH] try apc caching for views --- app.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.php b/app.php index 8baddab7..4af9cf4e 100644 --- a/app.php +++ b/app.php @@ -63,15 +63,16 @@ $appContainer = new \Slim\Container([ 'view' => function($container) { $view_time_start = microtime(true); - $view = new \Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache'); + #$view = new \Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache'); fwrite($fp, "!!!App - view load time : " . round((microtime(true) - $view_time_start),6) . "\n"); - return $view; if (!apcu_exists("views")) { apcu_store("views", new \Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache')); } - return apcu_fetch("views"); + $view = apcu_fetch("views"); + fwrite($fp, "!!!App - view load time : " . round((microtime(true) - $view_time_start),6) . "\n"); + return $view; }, 'LoginControllerInstance' => function($container) {