2011-02-22 79 views

回答

3

您可能想要使用两种缓存:查询缓存结果缓存。您可以在doctrine docs中阅读更多关于它的信息。

在示例中,您会发现Doctrine_Cache_Apc驱动程序。使用其他类型的驱动程序(如memcache)非常简单。只需使用适当的类名(对于memcache,它是Doctrine_Cache_Memcache)。

例(在ProjectConfiguration.class.php):

public function configureDoctrine(Doctrine_Manager $manager) 
{ 
    $cacheDriver = new Doctrine_Cache_Memcache($options); // insert your options! 
    $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, $cacheDriver); 
} 

我约了symfony +学说缓存文章可能会有所帮助,以及:http://www.zalas.eu/symfony-meets-apc-alternative-php-cache

我提到APC,但它会为内存缓存工作了。