Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of weaving dreams to improve the speed of web page access

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

I would like to share with you how to weave dreams to improve the speed of web access. I believe most people don't know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. let's learn about it!

How to weave dreams to improve the speed of web page access

We know that speeding up the opening of web pages is an effective strategy to improve user experience. There are many factors that affect the opening speed of web pages. Today, let's talk about how to speed up the opening speed of web pages by optimizing the internal program of dream weaving CMS.

First of all, to deal with the Javascript of the article page, there is a long Javascript in front of the default template, there may be a little more 2KB, and each page has a lot of 2KG. I will extract this JS, save it as a file, and download it once in the future. However, be careful to replace the paths in JS according to your own situation.

Secondly, I found that the article got stuck in the number of clicks, and sometimes the difference was less than ten seconds. I felt very bad. I was looking up the data, which affected the speed. In fact, we can write it in AJAX here. The specific method is as follows:

1. Modify the template to

Get rid of this line, plus

2. Add a JS function to the JS file mentioned in the first step

Function getClick (aid,mid) {var taget_obj = document.getElementById ('article_click'); myajax = new DedeAjax (taget_obj,false,false,''); myajax.SendGet2 ("/ plus/count.php?ajax=yes&mid=" + mid + "& aid=" + aid); / / change the actual path to the website DedeXHTTP = null;} depending on the situation

3. Modify the plus/count.php file and add the following code before exit ()

If (! empty ($ajax)) {$row = $dsql- > GetOne ("Select click From `{$maintable} `where {$idtype} ='$aid'"); if (is_array ($row)) {echo $row ['click'];}}

3. Change getDigg ({dede:field.id/}) to:

GetClick ({dede:field name='id'/}, mid= {dede:field name='mid'/}); getDigg ({dede:field.id/});

In fact, as long as the getClick function is placed at the end of the article, it doesn't matter anywhere.

The above is all the contents of the method of weaving dreams to improve the speed of web page access. Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report