Skip memcache retrieval if the expiry time is defined as 0 (after all, we clearly don't want stale data)

develop
Sven Slootweg 12 years ago
parent f54722d1a7
commit 75a5f0b7e7

@ -62,10 +62,10 @@ class CachedPDO extends PDO
$query_hash = md5($query); $query_hash = md5($query);
$parameter_hash = md5(serialize($parameters)); $parameter_hash = md5(serialize($parameters));
$cache_hash = $query_hash . $parameter_hash; $cache_hash = $query_hash . $parameter_hash;
$return_object = new stdClass; $return_object = new stdClass;
if($result = mc_get($cache_hash)) if($expiry != 0 && $result = mc_get($cache_hash))
{ {
$return_object->source = "memcache"; $return_object->source = "memcache";
$return_object->data = $result; $return_object->data = $result;

Loading…
Cancel
Save