My problem:
I am making Apache Benchmark test to see if CakePHP APC engine works. However, if I setup Cake's caching configuration to use APC engine, the cache files with serialized cached data are still being created in tmp folder, which make me think that file caching is being used.
I also get no performance benefit: using APC and File engines, test results are ~ 4 sec. If I hardcode plain apc_add() and apc_fetch functions in my controller, the test result gets better: ~3.5 sec.
SO the APC is working, but Cake somewhy can't use it.
My setup:
bootstrap.php:
/*Cache::config('default', array(
'engine' => 'File',
'duration'=> '+999 days',
'prefix' => 'file_',
));*/
Cache::config('default', array(
'engine' => 'Apc',
'duration'=> '+999 days',
'prefix' => 'apc_',
));
controller:
$catalogsLatest = Cache::read('catalogsLatest');
if(!$catalogsLatest){
$catalogsLatest = $this->Catalog->getCatalogs('latest', 5, array('Upload'));
Cache::write('catalogsLatest', $catalogsLatest);
}
php.ini:
[APC]
apc.enabled = 1
apc.enable_cli = 1
apc.max_file_size = 64M
If I check Cache::settings() in controller before or after cache executuon, I get these results:
Array
(
[engine] => Apc
[path] => E:\wamp\www\cat\app\tmp\cache\
[prefix] => apc_
[lock] => 1
[serialize] =>
[isWindows] => 1
[mask] => 436
[duration] => 86313600
[probability] => 100
[groups] => Array
(
)
)
I am using CakePHP 2.2.4.