Comprehensive optimization of V4.0 and Ajax Tag Usage Techniques _ Branch News related

Source: Internet
Author: User
Tags access database
Known. Kesioncms V4.0 has a qualitative flyby both functionally and in terms of performance. No longer the previous version of the 1-second system can generate only 1 articles. But recently, some users have also found that the speed is not much improved. Now I'll give you a general summary.

1, the label calls unreasonable

A, custom static label (maximum impact)

Some users use a custom static label for convenience. Even make a static tag call to the entire page template. What's even more scary is inserting a lot of system function tags into custom static tags, customizing SQL tags, and so on.

Testing if you insert system function tags and custom SQL tags into a custom static label, the system's build speed will be greatly compromised. The reason is as follows: Originally just read the database to do once the label replacement work, and with the help of the custom static label virtually requires at least two times to replace the label. So performance drops.

Through the above analysis: the solution is to minimize or not use the custom static label. Never insert system function tags and custom SQL tags in a custom static label.

B, custom SQL tags

Friends who have used custom SQL tags know that a SQL tag corresponds to a SQL query statement. Whether the structure of SQL is reasonable or not directly affects the performance of the system.

Examples are as follows:

Statement one: Select * from Ks_article where Tid in (' column ID ') Order BY id DESC

Statement two: Select top id,title,adddate from ks_article Where tid= ' column ID ' ORDER BY id DESC

and assume that the loop body is as follows:

Copy Code code as follows:

[loop=10]
<li>
<ahref= "{$Field (id,getinfourl,1,1)}" target= "_blank" >{$Field (title,text,5,..., 0,)}</a> ({$Field ( adddate,date,yyyy mm month DD Day)}
</li>
[/loop]


Above the code snippet. Obviously, the final effect is the same, but the execution efficiency of statement Two is better than statement one. The more data you have, the more obvious it will be. Here is not the details to explain why, interested friends can refer to: http://www.cnblogs.com/xhp5678/archive/2006/07/07/445206.html, http://www.cnblogs.com/ Oec2003/archive/2007/05/09/740048.html
C. System function Label

Kesioncms the system function tag as an entry-level tag, all code is integrated within the core code's function. A lot of optimizations have been done on the statement. In principle, users do not need to pay attention to what to use. But if you look at it a little bit, you'll find that many of the tags support GM. Careful friends will find tags in the property of the "sex column" in the column: "The current column (general)", "not designated columns" and so on. When you specify the current column (general), the tag you build is the generic label in this model. This way, you don't have to build a lot of labels. Reduce the number of database label substitutions from the page ...
2, Column division is not reasonable
Some users column division is extremely unreasonable, a column under the article incredibly reached tens of thousands of data. For more articles under the column, it is recommended to subdivide the column. V4.0 introduces the model, and can also distribute the data to the user-built data table through the Self modeling model. Thus effectively reducing the pressure of a single data table.

3, do not regularly maintain the database

Users who use an Access database are requested to compress and repair the database periodically, and users of the SQL database can periodically purge logs, compress, and so on. Regular maintenance of the database you can also find that the performance of the system will improve.












When does the tag use AJAX output














Kesioncms V4.0 The original introduction of the tag Ajax output function, but some users do not understand this, not clear friends can learn about this http://tech.163.com/05/0908/17/1T55SUPP00091K8Q.html

1, End-level list label (pagination label)

When the site's column information does not allow others to collect, can be exported with Ajax output.

When you have more than 1000 articles in your column, consider AJAX output. For the following reasons: Let's say you have 20 per page display. Then each generation of this section page will need to generate 1000/20=50 static page. If there are 20 columns, according to the whole generation, the moment will be generated 50*20=1000 static page, when the server occupies the resources will be dramatically increased. Cause the Publishing section page is very slow. If it is an AJAX output, each column, regardless of the number of articles, will generate a static page. In fact, Ajax is not refreshing dynamic invocation. When you use AJAX output, you add new content in the background, not even need to generate the column page, because he will dynamically update.

2, the latest update, click Ranking, recommended information, such as calls

When your content page has generated a static page, have you ever because the content page can not automatically update click Ranking, can not automatically update the latest added articles, can not automatically update the recommended information and trouble? Kesioncms V4.0 introduced the AJAX output and solved the problem completely. You can simply select the label output format Ajax.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.