我想我快疯了,我正在尝试实现 Zend_Cache 来缓存我的数据库查询。我知道它是如何工作的以及如何配置。
但是我找不到为缓存条目设置标识符的好方法。我有一种在我的数据库中搜索记录的方法(基于具有搜索值的数组)。
/**
* Find Record(s)
* Returns one record, or array with objects
*
* @param array $search Search columns => value
* @param integer $limit Limit results
* @return array One record , or array with objects
*/
public function find(array $search, $limit = null)
{
$identifier = 'NoIdea';
if (!($data = $this->_cache->load($identifier))) {
// fetch
// save to cache with $identifier..
}
但是在这种情况下可以使用什么样的标识符呢?