My problem:
I am doing an Apache Benchmark test to check if CakePHP APC engine is working. However, if I configure Cake caching configuration to use the APC mechanism, cache files with serialized cached data are still created in the tmp folder, which makes me think that file caching is being used.
I also do not get any performance benefit: using APC and file engines, test results are ~ 4 sec. If I hard-coded simple apc_add () and apc_fetch functions in my controller, the test result improved: ~ 3.5 s.
SO APC works, but Cake cannot 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 the controller before or after the cache is executed, I get the following 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.