Home CMS Tutorial DEDECMS How does Dreamweaver improve the speed of web page access?

How does Dreamweaver improve the speed of web page access?

Nov 09, 2019 pm 01:22 PM
dream weaving Access speed

How does Dreamweaver improve the speed of web page access?

How to improve the speed of web page access

We know that speeding up the opening speed of web pages is to improve the user experience an effective strategy. There are many factors that affect the opening speed of web pages. Today I will talk about how to speed up the opening speed of web pages by optimizing the internal program of DreamWeaver CMS.

First of all, process the Javascript of the article page. There is a large section of Javascript in front of the default template, which may be a little more than 2KB, and each page is 2KG. I will extract this JS and save it as a file. I only need to download it once in the future. But be careful to replace the path in JS according to your own situation.

Secondly, I found that the article was stuck when it came to the number of clicks. The time difference was less than ten seconds. I felt very bad. It turned out that I was checking data, which affected the speed. In fact, we can write it here using AJAX. The specific method is:

1. Modify the template to remove the line

<script src="{dede:field name=&#39;phpurl&#39;/}/count.php?view=yes&aid={dede:field name=&#39;id&#39;/}&mid={dede:field name=&#39;mid&#39;/}" type=&#39;text/javascript&#39; language="javascript"></script>
Copy after login

and add

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

function getClick(aid,mid) 
{ 
var taget_obj = document.getElementById(&#39;article_click&#39;); 
myajax = new DedeAjax(taget_obj,false,false,&#39;&#39;,&#39;&#39;,&#39;&#39;); 
myajax.SendGet2("/plus/count.php?ajax=yes&mid=" +mid +"&aid=" +aid); //这里要根据情况改成网站的实际路径 
DedeXHTTP = null; 
}
Copy after login

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

if(!empty($ajax)) 
{ 
$row = $dsql->GetOne(" Select click From `{$maintable}` where {$idtype}=&#39;$aid&#39; "); 
if(is_array($row)) 
{ 
echo $row[&#39;click&#39;]; 
} 
}
Copy after login

3. PutChanged to:

<script language="javascript" type="text/javascript">getClick({dede:field name=&#39;id&#39;/},mid={dede:field name=&#39;mid&#39;/});getDigg({dede:field.id/});</script>。
Copy after login

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

Recommended tutorial: dedecms tutorial

The above is the detailed content of How does Dreamweaver improve the speed of web page access?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to improve the access speed of Python website through front-end optimization? How to improve the access speed of Python website through front-end optimization? Aug 05, 2023 am 10:21 AM

How to improve the access speed of Python website through front-end optimization? With the development of the Internet, website access speed has become one of the important indicators of user experience. For websites developed using Python, how to improve access speed through front-end optimization is a problem that must be solved. This article will introduce some front-end optimization techniques to help improve the access speed of Python websites. Compress and merge static files In web pages, static files such as CSS, JavaScript and images will take up a lot of bandwidth and load.

PHP website performance optimization: How to optimize the file upload process to increase access speed? PHP website performance optimization: How to optimize the file upload process to increase access speed? Aug 25, 2023 pm 07:15 PM

PHP website performance optimization: How to optimize the file upload process to increase access speed? File upload is a common feature in most web applications. However, when it comes to large files or when multiple users are uploading files at the same time, the file upload feature can become a bottleneck for website performance. In this article, we’ll explore how to improve your website’s speed by optimizing your file upload process. Increase upload file size limit By default, PHP's file upload size is limited by the upload_ in the php.ini file.

How to import css in DreamWeaver How to import css in DreamWeaver Dec 03, 2020 pm 04:03 PM

How to import css into DreamWeaver: 1. Place the HTML template file in the "templets" folder; 2. Change the suffix of the HTML file to ".htm"; 3. Add "{dede:" in front of the original style path: global.cfg_templets_skin/}" can be used.

To solve the problem of Python website access speed, use database optimization methods such as indexing and caching. To solve the problem of Python website access speed, use database optimization methods such as indexing and caching. Aug 05, 2023 am 11:24 AM

To solve the problem of Python website access speed, use database optimization methods such as indexing and caching. In the process of developing and maintaining Python websites, we often encounter the problem of slow website access speed. In order to improve the response speed of the website, we can use some database optimization methods, such as indexing and caching. This article will introduce how to use these methods to solve Python website access speed problems, and provide corresponding code examples for reference. 1. Use indexes to optimize database queries. Indexes are a fast search structure for data in the database, which can greatly

How to improve the access speed of Python website through database optimization? How to improve the access speed of Python website through database optimization? Aug 07, 2023 am 11:29 AM

How to improve the access speed of Python website through database optimization? Summary When building a Python website, a database is a critical component. If the database access speed is slow, it will directly affect the performance and user experience of the website. This article will discuss some ways to optimize your database to improve the access speed of your Python website, along with some sample code. Introduction For most Python websites, the database is a key part of storing and retrieving data. If not optimized, the database can become a performance bottleneck. Book

PHP website performance optimization: How to reduce DOM elements to improve access speed? PHP website performance optimization: How to reduce DOM elements to improve access speed? Aug 05, 2023 pm 03:01 PM

PHP website performance optimization: How to reduce DOM elements to improve access speed? With the rapid development of the Internet, website performance optimization has become more and more important. A responsive website not only improves user experience but also increases conversion rates and search engine rankings. In the process of PHP website performance optimization, reducing DOM elements is a key link. This article will introduce some methods of reducing DOM elements and provide code examples to illustrate how to implement these optimizations. Merge multiple DOM elements when a page needs to load a large number of DOM elements

7 effective ways to quickly solve Go language website access speed problems 7 effective ways to quickly solve Go language website access speed problems Aug 05, 2023 pm 04:43 PM

7 Effective Ways to Quickly Solve Go Language Website Access Speed ​​Problems With the rapid development of the Internet, website access speed is crucial to user experience. As a high-performance programming language, Go language is widely used in building high-concurrency network applications. However, in actual development, we may encounter the problem of slow access to Go language websites. This article will introduce 7 effective ways to solve this problem and provide corresponding code examples. Caching is one of the most common and effective ways to improve website access speed.

How to optimize the access speed of PHP website through lazy loading of images? How to optimize the access speed of PHP website through lazy loading of images? Aug 05, 2023 pm 02:53 PM

How to optimize the access speed of PHP website through lazy loading of images? With the development of mobile Internet, more and more users use mobile devices to access websites. However, due to the relatively slow network speeds of mobile devices, loading speed becomes even more important. Among them, the loading speed of images has a great impact on website performance. In order to improve the access speed of PHP website, you can optimize it by lazy loading of images. Lazy loading of images means that when a web page is loaded, only images in the visible area are loaded instead of loading all images at once. In this way, first

See all articles