Permalink
Browse files

Set cache to only cache when required.

  • Loading branch information...
m4tthumphrey committed Jul 3, 2012
1 parent 3c6a3f3 commit 5e422e4bc5ec1fd25aceb678c477a8a4cd6f62ab
Showing with 5 additions and 2 deletions.
  1. +5 −2 classes/api.php
View
@@ -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;

0 comments on commit 5e422e4

Please sign in to comment.