My code:
- Code: Select all
class UsersPeer extends BaseUsersPeer
{
public static function getHashUser($hash)
{
$c = new Criteria();
$c->add(UsersPeer::HASH,$hash);
return UsersPeer::doSelectOne($c);
}
}
Does it make sense to cache this function? My understanding says that since the string value passed to the function shall always be different for different users, the function shall execute each time. However, it shall not execute again for the the users, for whom the string value has previously been passed to the method and record retrieved. Only in such cases the function caching shall work. Given that there are approximately 50K users, does it make any sense enabling caching for this method ?
