开发者

What does Wordpress do on just the home page (slow loading)?

开发者 https://www.devze.com 2023-01-20 09:13 出处:网络
I have a problem with a wordpress site and I really can\'t figure out what causes it. All the pages in the site load perfectly fine, they are quite stuffed with content but the load time is ok and so

I have a problem with a wordpress site and I really can't figure out what causes it.

All the pages in the site load perfectly fine, they are quite stuffed with content but the load time is ok and so is memory usage as they have no problem with a 32M memory limit set in wp-settings.php.

The problem comes with the home page. It takes several seconds to load (excluding other content, just the main request) and fails (where 'fails' stands for blank page shown) unless I raise the memory limit above 300M.

Possible suggestion 1: check index.php code

Done. I replaced it with a blank page only containing the word TEST, still same slow loading and blank page.

Possible suggestion 2: disable开发者_开发技巧 all plugins

Done. Disabled each and every plugin and still same exact behaviour.

My current workaround

The only thing that I could find to temporarily solve the issue, is redirecting (via wordpress' internal rewrite) any request for / to a custom page which is linked to index.php. This way I have the homepage working fine, quickly and under the 32M memory limit.

Now, this works but it's a horribly dirty hack, so how can I find out what wordpress is doing when I ask for the home page before loading the template given that it has nothing to do with plugins?


If you've tried replacing index.php with just plain text then i would definitely check your .htaccess file for errors, extra characters, or some type of invalid configuration. Disable it and see if that helps for starters.


To see if anything comes out try adding WP_DEBUG=true to wp-config.php Might show you if something else is erroring earlier But otherwise yes kachegrind or xdebug definately

Also if on unix and you have access try strace command on the apache process


Not easy to tell, but there is a way to find out: use the xdebug profiler, and then use kcachegrind or its windows port to view its results. It will show you lots of data, including a visual chart, which will hopefully be very helpful in identifying where is PHP spending most of its time...


Is the server itself doing any pre/post processing on the homepage?

Turning on PHP errors may shed some light on the process as will looking at the httpd error log.

Out of curiosity, are you positive your site hasn't been hijacked?

0

精彩评论

暂无评论...
验证码 换一张
取 消