Sunday, November 1, 2009

Cakephp slow on Windows Vista

I use Vista for development. I find that cakephp development on Vista is painfully slow. Some of my coworkers use mac. I, being a (relatively) poor entrepreneur cannot afford a mac (yet), so I have no option but to keep waiting for page to load for sometimes upto 60 seconds.

I tried various ways to handle the problem - apc and xcache both didn't work with my version of php and apache on windows. Then one day it occurred to me - apc is just an elaborate in-memory cache, so why dont I put my cakephp cache files in memory?
So started search for a (free) RAM Disk. After trying few, I found Dataram RAM Disk was the only one that didn't crash on Vista. Those folks have done a good job with their product. I just need a 10M disk, so their free option works well for my dev server.

Next updated the core.php with:

      Cache::config('_cake_core_', array(
'engine' => 'File',
'path'=> 'E:/',
First few times were still painfully slow, but as cache filled up, the website now loads blazing fast. I can now again develop on Vista!