Any ideas please?
Thanks.
Any ideas please?
Thanks.
It should support APC as an opcode cache -- it's just PHP code, afterall.
And it seems there is an APC-related class to use APC as a cache for data : see ApcEngine
.
See also, in the manual : 7.2.2 Cache Engines in Cake, in which it says there is support for APC, XCache, File, and memcached.
In cake's /app/config/core.php
,there are some options for you to set the cache engines(version newer than 1.2).e.g
APC (http://pecl.php.net/package/APC)
Cache::config('default', array(
'engine' => 'Apc', //[required]
'duration'=> 3600, //[optional]
'probability'=> 100, //[optional]
'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
));
Just to add to the other good answers provided already, there are some tricks to get cake to use anything other than file cache for it's internal caching. This code will make cake use APC,Xcache, whatever for it's core cache (APC in this example)
Cache::config('_cake_core_',
array(
'engine' => 'Apc',
'duration'=> 3600,
'probability'=> 100,
)
);
Cake can also cache your models by putting this in your controllers/appcontroller.
var $persistModel = true;
However, models can only use file cache
These were all stolen from this article, which includes a bunch of ways to use cake's caching mechanisms to speed up your app
http://www.pseudocoder.com/archives/8-ways-to-speed-up-cakephp-apps
Also, as Pascal has mentioned, by installing and configuring APC, your PHP opcode is automatically cached.
For even more caching goodness, php supports memcache as an alternative to files as a session store, which is particularly useful in load balanced environments. An example of a single server implementation would be to put this in your ini
extension=memcache.so
session.save_handler = memcache
session.save_path = "tcp://127.0.0.1:11211?persistent=1"
And this in your core.php
Configure::write('Session.save', 'php');