I have some issues saving identifiers for cache objects in Zend_Cache
. The Zend_Cache
identifiers have to be really sanitized (no special chars, no spaces, etc). Some of my internal identifiers have spaces in it, so it's a problem for me to save cache objects.
I was thinking about converting the zend_cache identifier using md5() before saving it, such as:
$cacheId = md5(self::CACHE_PREFIX . $propertyId);
if (($address = $cache->load($cacheId)) === false) {
.....
$cache->save($cacheId, $address);
}
(Here for example, $propertyId
might by a string with spaces)
My question is how unique are those md5 strings i'm creating? would it be possible that two of my cache objects will have the same identifier? Any suggestions?