The Zend Framework offers a class named Zend_Cache. One can use several different kinds of caching-methods. For example:
Because of the defined goal to speed up Zend_Db we have to concentrate on the database activities. To use the magic methods of the database-class, this class has to scan the tables to get the structure to work with. With large tables this can be very costly. In picture 1 one can see in the bottom left time costs of over 2 million. Our goal is to save the structures (metadata) of the tables in the cache so the class doesn't always have to scan the whole table on every query. File-cacheUsing files as a cache may not be the fastest (to be exactly: the slowest) but the easiest way to optimize the database access. You just have to add the following code to your bootstrap.php: $frontendOptions = array( 'automatic_serialization' => true);$backendOptions = array( 'cache_dir' => '../cache/');$dbCache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);Zend_Db_Table_Abstract::setDefaultMetadataCache($dbCache); In picture 2 the impacts of this little piece of code can be seen. The time costs are reduced to a little over 1,3 million. As said before, file is the slowest of all optimizations. With the use of Memcached (a memcached server) the costs can be further reduced.