一、要進(jìn)入dedecms根目錄中找下目錄:
include/inc/inc_fun_SpGetArcList.php
二、找到之后最好下載到本地打開(kāi)找到如下代碼:
for($i=0;$i<$ridnum;$i++){ if($tpsql==””) $tpsql .= ” And ( (“.TypeGetSunID($reids[$i],$dsql,’arc’).” Or arc.typeid2='”.$reids[$i].”‘) “; else $tpsql .= ” Or (“.TypeGetSunID($reids[$i],$dsql,’arc’).” Or arc.typeid2='”.$reids[$i].”‘) “; }
三、找到的如上代碼之后可以把上面代碼注釋掉或者替換都可以,替換改成如下代碼:
for($i=0;$i<$ridnum;$i++){ if($tpsql==””) $tpsql .= ” And (“.TypeGetSunID($reids[$i],$dsql,’arc’); else $tpsql .= ” Or “.TypeGetSunID($reids[$i],$dsql,’arc’);
查找:
$orwhere .= " And ( arc.typeid in ($sonids) Or arc.typeid2 in ($sonids) ) "
替換為:
$orwhere .= " And arc.typeid in ($sonids) ";
具體優(yōu)化步驟:
1、關(guān)閉副欄目,生成速度從50秒20頁(yè)降到20秒20頁(yè)
2、刪除文檔模版中的調(diào)用隨機(jī)文檔的標(biāo)簽(即arclist中帶有sort=rand的)開(kāi)啟后臺(tái)中能找到的所有緩存,生成速度從20秒20頁(yè)降到6秒多一頁(yè)
3、刪除文檔模版中的相關(guān)文檔,生成速度從6秒猛降到不到一秒
推薦教程:dedecms教程