Wordpress generates pages very slowly

WBOY
Release: 2016-08-04 09:21:27
Original
1374 people have browsed it

When WordPress accesses the homepage and category pages, if you cancel the cache and re-execute the php program, the page generation will be very slow.

I have confirmed that there is no problem with my network. It is not that the page has foreign links, Google fonts, etc. It is that after the front-end request is sent, it takes 5-15 seconds to receive the response from the server. Wordpress generates pages very slowly

The first request is the page file, and you can see that it took 9 seconds to wait for the server to respond. . .

I executed this code once in the wordpress template where the PHP program in index.php generates the article list to test the execution time:
Wordpress generates pages very slowly

The result is:
Wordpress generates pages very slowly

My website was built on Alibaba Cloud. This result seems to be caused by the background. However, why is the call to article data sometimes fast and sometimes slow? I feel that it is not the execution of the PHP program that is so slow, but the database retrieval of data that is too slow. After all, there are only about 10 articles now. I know basically nothing about databases and backends, and I can only write a little bit of php code. Please give me some pointers as to the possible reasons, thank you. . .

Oh, by the way, I use centos, apache and mariadb.

Reply content:

When WordPress accesses the homepage and category pages, if the cache is canceled and the PHP program is re-executed, the page generation will be very slow.

I have confirmed that there is no problem with my network. It is not that the page has foreign links, Google fonts, etc. It is that after the front-end request is sent, it takes 5-15 seconds to receive the response from the server. Wordpress generates pages very slowly

The first request is the page file, and you can see that it took 9 seconds to wait for the server to respond. . .

I executed this code once in the wordpress template where the PHP program in index.php generates the article list to test the execution time:
Wordpress generates pages very slowly

The result is:
Wordpress generates pages very slowly

My website was built on Alibaba Cloud. This result seems to be caused by the background. However, why is the call to article data sometimes fast and sometimes slow? I feel that it is not the execution of the PHP program that is so slow, but the database retrieval of data that is too slow. After all, there are only about 10 articles now. I know basically nothing about databases and backends, and I can only write a little bit of php code. Please give me some pointers as to the possible reasons, thank you. . .

Oh, by the way, I use centos, apache and mariadb.

Slow is right, WP is already very slow, you still need to cancel the cache. No need to look for reasons, WP is just like that.
WP said that upgrading to PHP7 can increase the speed by 30%, you may consider it.
I don’t know why so many people like WP. It was really good 10 years ago, and now it’s no worse than any one I can find. Drupal beats it.

I don’t know how your server is configured.
Wordpress is indeed slow, I have used it before.
-From my experience, the general reasons include Google fonts (turn off Google fonts or switch to domestic CDN), avatar problem (same as above), too many plug-ins, too low configuration, etc.
-Your screenshot shows that TTFB is more than 8 seconds old. For a small personal website, it is recommended to use nginx.
-Use php7 (said to speed up).
-It is recommended to change wp.

In China, you know, WP has Qiniu’s CDN plug-in that you can use. . . The speed increase is quite obviousWordpress generates pages very slowly
But you need to apply for a Qiniu account. Qiniu’s free monthly traffic to your personal website is generally enough

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!