Skip to content

Commit

Permalink
Set cache to only cache when required.
Browse files Browse the repository at this point in the history
  • Loading branch information
m4tthumphrey committed Jul 3, 2012
1 parent 3c6a3f3 commit 5e422e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/api.php
Expand Up @@ -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;
Expand Down

0 comments on commit 5e422e4

Please sign in to comment.