PHP ob_start vs opcode APC, explain differences and real world usage?
问题 Premise: I'm not trying to reinvent the wheel, I'm just trying to understand. Output caching can be implemented easily: //GetFromMyCache returns the page if it finds the file otherwise returns FALSE if( ($page = GetFromMyCache($page_id)) !== FALSE ) { echo $page; //sending out page from cache exit(); } //since we reach this point in code, it means page was not in cache ob_start(); //let's start caching //we process the page getting data from DB //saving processed page in cache and flushing it