我正在使用我的PHP代码Smarty,我喜欢缓存一些网站页面,所以我使用以下代码:// TOP of script ob_start(); // start the output buffer $cachefile ="cache/cachefile.html"; // normal PHP script $smarty->display('somefile.tpl.html') ; $fp = fopen($cachefile, 'w'); // open the cache file for writing fwrite($fp, ob_get_contents()); // save the contents of output buffer to the file fclose($fp); // close the ...
只是寻找一条建议.在我们的一个网页上,我们有一个辩论/论坛网站.每当用户请求辩论页面时,他/她将获得所有主题的列表(以及他们的答案计数等). 当用户请求特定主题/线程时,线程的所有答案将向用户显示长的用户名,用户图片,年龄,来自答案海报的总论坛帖子的数量. 每次访问页面时,都会使用MySQL查询检索所有内容.但是这开始变得非常缓慢(特别是对于大线程,3000个答案). 我想以某种方式缓存辩论条目,以加快这个过程.然而问题是,如果我自...