From 135174f7abc759ceff312fd9c54bdfcc2edf2b2a Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 10 Jul 2017 16:05:33 +0200 Subject: [PATCH] site: memcache for 30s the pool status (per algo) This is the most requested page (used on all pool tabs) algo var is required to keep selected tr without javascript... --- web/yaamp/modules/site/SiteController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/web/yaamp/modules/site/SiteController.php b/web/yaamp/modules/site/SiteController.php index d614814..f08168a 100644 --- a/web/yaamp/modules/site/SiteController.php +++ b/web/yaamp/modules/site/SiteController.php @@ -394,7 +394,23 @@ class SiteController extends CommonController public function actionCurrent_results() { + // Pool Status : public right panel with all algos and live stats + $algo = user()->getState('yaamp-algo'); + $memcache = controller()->memcache->memcache; + $html = memcache_get($memcache, "current_results_".$algo); + + if (!empty($html)) { + echo $html; + return; + } + + ob_start(); + ob_implicit_flush(false); $this->renderPartial('results/current_results'); + $html = ob_get_clean(); + echo $html; + + memcache_set($memcache, "current_results_".$algo, $html, MEMCACHE_COMPRESSED, 30); } public function actionHistory_results()