Web Design
Mobile Internet
Brand Design
Innovative
News
Encyclopedias

Several Factors of Slow Opening of PHP Website

Date:2013-03-03 Source: Shangpin China Type: website encyclopedia
Word Size: small   medium   big

Beijing website construction Company Shangpin China: Recently, I often heard friends say that the website opens slowly, which leads to a lot of IP loss every day. There are many reasons for the slow opening of the website. Apart from the network itself, the server and Website production The program itself is also an important reason for the slow opening of websites. Let's talk about the factors that affect the slow opening of PHP+MySQL websites based on my own experience.

1. Unreasonable database table structure and unreasonable database query statement
When creating MySQL database tables, set the fields that are often used as query conditions as indexes, which can improve the speed of data query and the speed of website opening.
For PHP+MySQL dynamic websites, the database select operation is often used. When using the select operation, do not easily use select * from tablename, because such a query is slow and will take up more memory, affecting the overall running speed of PHP programs, and thus affecting the opening speed of websites. It is recommended to use the select query statement for specific fields, such as select fieldname from tablename. This query method will reduce MySQL execution time and improve efficiency.

2. PHP program redundancy, large number of read/write disks
When building a PHP+MySQL website, you will find that there is a lot of redundancy in some programs, which extends the program execution time. For example, repeated SQL query operations, repeated variable assignment, etc. When this happens, it's better to find professionals to help you optimize the program and improve the overall running time of the program.
Some PHP+MySQL website programs will perform a large number of disk read and write operations, especially disk write operations, which will occupy a large number of disk IO, resulting in slow program operation. In serious cases, the server will crash. When such a situation occurs, you should try to reduce unnecessary disk writes, and perform related optimization operations on the disk, such as disk grooming, to improve the overall operating efficiency of the disk.

3. There are a lot of pictures or flash on the webpage
If there are a lot of pictures or flash on the web page, it will also affect the opening speed of the website. Reduce the picture or flash on the web page, or optimize and reduce the size of the picture to improve the opening speed of the web page.

4. Try to use static pages
When using PHP+MySQL to build a website, try to use open source programs that can generate static pages, such as DEDECMS. The time to open a static page is far less than the time to open a dynamic page, because the four reasons mentioned above do not exist in the static page. But it will consume more disk space because the generated static pages will take up a lot of disk space.

5. Server software
I met a friend who installed several firewalls on VPS before. The VPS server is secure, but the web page is slow to open. Avoid installing unnecessary software on VPS or independent servers as much as possible to prevent the server from running slowly, resulting in slow website opening.

6. Too many references to other websites
Including pictures and video files from other websites. If you directly refer to something from another website on the page, and the speed of that website is slow, or the page of that website no longer exists, then your opening speed will be very slow.

7. There are a lot of JS codes on the web page
A large number of JS codes are also an important reason for slow website opening speed, especially some unknown alliance advertising codes, which have a very obvious impact on website opening speed.

This article was published on Beijing website production Company Shangpin China //ihucc.com/


Please contact our consultant

+86 10-60259772

Please provide your contact number. The project manager of shangpin China will contact you as soon as possible.