From 4036b05def13d98f8d4943281dc18c6a7ba722ec Mon Sep 17 00:00:00 2001 From: Lufei Date: Mon, 5 Jun 2023 14:36:32 +0800 Subject: [PATCH] + Cache for contribute. --- module/block/control.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/module/block/control.php b/module/block/control.php index afa468a1ce..f831400eef 100755 --- a/module/block/control.php +++ b/module/block/control.php @@ -418,7 +418,16 @@ class block extends control */ public function contribute() { - $this->view->data = $this->loadModel('user')->getPersonalData(); + if($this->config->cache->enable && $this->cache->has('contributeBlockData')) + { + $data = $this->cache->get('contributeBlockData'); + } + else + { + $data = $this->loadModel('user')->getPersonalData(); + if($this->config->cache->enable) $this->cache->set('contributeBlockData', $data); + } + $this->view->data = $data; $this->display(); }