Michele de Candia
Michele de Candia

Reputation: 45

Unexpected huge delay on homepage loading in wordpress

I have my wordpress site without any big plugin, very light, except for a theme that adds some external js. I'm experiencing a delay of 8525ms on the loading of the main document, as you can see from the attachment:

enter image description here

As you can see also here in the details it's just this homepage which requests these 8 seconds to load: enter image description here

I tried compressing the site, minifying all the script, disabling the json api and some other tricks but still that page will take 8525ms to load. Why? Any tricks? Even assuming that some scripts require some seconds to load it is normal to have all that time for a simple page with 20 super compressed pics with a scroll script and a gradient background?

Upvotes: 0

Views: 171

Answers (2)

Michele de Candia
Michele de Candia

Reputation: 45

Following your prompt answers I figured out that the problem was the memory limit for the php so I solved doing this:

  1. Adding this string @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '2048M' ) ); to the line 69 of my admin.php file.

  2. Adding <?php define('WP_MEMORY_LIMIT', '256M'); ?>to the wp-config.php

Now all my homepage loads in 700ms even if my provider still remains a little decadent italian one, but decent.

Upvotes: 2

Jim Deville
Jim Deville

Reputation: 10662

Your delay is happening before any scripts are loaded, and the JSON api shouldn't affect the loading of the main site unless you are calling it from within the PHP code itself. The slowdown you are seeing is in PHP, not in the browser. It might be a problem in the php side of the theme, or it might be an issue with your server or the database.

Upvotes: 0

Related Questions