Home  >  Article  >  CMS Tutorial  >  How to speed up dedeCMS content generation

How to speed up dedeCMS content generation

藏色散人
藏色散人Original
2019-12-10 09:37:392610browse

How to speed up dedeCMS content generation

How to speed up the content generation speed of DedeCMS?

Everyone will often encounter this problem. If Weaver There are many documents in DreamBackend, and when the data is relatively large, generating column documents will be quite slow. Recently, the editor has been chatting with a friend about how to speed up dedecms generation. I think this is also a shortcoming of dedecms! For example, if a dedecms has hundreds of thousands or millions of visits, it will bring a lot of garbage to the website. This will lead to a decrease in dedemcs generation speed and ultimately lead to users not getting the best experience.

Recommended study: 梦Weavercms

I checked Baidu and found no good solution to this problem. Afterwards, the editor found a suitable piece of code from the dedecms official website. After being tested by the editor, the editor will briefly introduce the implementation method.

The first step is to enter the root directory of dedecms and find the next directory:

include/inc/inc_fun_SpGetArcList.php

After finding it, it is best to download it locally and open it to find the following code:

for($i=0;$i<$ridnum;$i++){ if($tpsql==””) $tpsql .= ” And ( (“.TypeGetSunID($reids[$i],$dsql,’arc’).” Or arc.typeid2=&#39;”.$reids[$i].”‘) “; else $tpsql .= ” Or (“.TypeGetSunID($reids[$i],$dsql,’arc’).” Or arc.typeid2=&#39;”.$reids[$i].”‘) “; }

After finding the above code You can comment out or replace the above code. Replace it with the following code:

for($i=0;$i<$ridnum;$i++){ if($tpsql==””) $tpsql .= ” And (“.TypeGetSunID($reids[$i],$dsql,’arc’); else $tpsql .= ” Or “.TypeGetSunID($reids[$i],$dsql,’arc’);

Find:

$orwhere .= " And ( arc.typeid in ($sonids) Or arc.typeid2 in ($sonids) ) "

and replace it with:

$orwhere .= " And arc.typeid in ($sonids) ";

Let’s look at the specific optimization of the generation. Steps:

1. Close the sub-column, and the generation speed is reduced from 50 seconds and 20 pages to 20 seconds and 20 pages.

2. Delete the label of the call document in the document template, that is, the label in the arclist With sort=rand, all caches that can be found in the background are enabled, and the generation speed drops from 20 seconds for 20 pages to more than 6 seconds for one page.

3. Delete related documents in the document template, and the generation speed jumps from 6 seconds. It dropped to less than one second, and the time to reach the middle was over. I was finally satisfied and no longer had to enjoy the slow generation speed!

The above is the detailed content of How to speed up dedeCMS content generation. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn