From 5e422e4bc5ec1fd25aceb678c477a8a4cd6f62ab Mon Sep 17 00:00:00 2001 From: Matt Humphrey Date: Tue, 3 Jul 2012 21:55:20 +0100 Subject: [PATCH] Set cache to only cache when required. --- classes/api.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/api.php b/classes/api.php index d2050ff..d0ccae6 100644 --- a/classes/api.php +++ b/classes/api.php @@ -46,8 +46,11 @@ public function get($path, $params = array(), $cache = null) catch (\CacheNotFoundException $e) { $data = $this->request($path, $params, 'GET'); - - \Cache::set($hash, $data, $cache_value); + + if ($cache !== false) + { + \Cache::set($hash, $data, $cache_value); + } } return $data;