I've started using PEAR Cache_Lite on some of the sites I'm working on a couple of months ago and it's great...but I ran into a bit of a problem : My site code is something like this : <?php require ("cache path....."); $options = array( 'cacheDir' =>'cache/', 'writeControl' => 'true', 'readControl' => 'true', 'fileNameProtection' => false, 'readControlType' => 'md5' ); $cache = new Cache_Lite_Output($options); $cache->setLifeTime(36000); $name="some name here"; if (!($cache->start($name,"cache")) ) { [B]error_reporting(0); [/B] //my main site code here ............. $cache->end(); } ?> Code (markup): My problem is that Cache_Lite saves a empty cache file when MySql/PHP fails and the script "dies" (and the output buffer is empty). How can I prevent this from happening ? Thanks .
Any reason why you opted for PEAR Cache_lite over opcode caches like eA, APC and xcache? PS. I also tried it once but it was too much manual work to setup files (maybe there's an easier way)
I'm also using eAccelerator which helps a lot too ...but output caching(PEAR Cache_lite) really makes a big difference for my sites - no PHP(except the PEAR files that manage the cache) and no MySQL queries are executed for days on my server. Settings up Cache_Lite takes some time but if you get it working and auto refreshing parts of the cache on events like new posts, new comments , etc it really speeds up any site and the server load goes down which means lower hardware/hosting costs.