Super slow frontend and panel not loading at all

I’ve read many threats of people complaining about super slow frontends and panels, but in all cases I’ve read it’s got to do with a hook, plugin, or similar extra. I don’t have any of that on my client’s site. Actually, the site was running normally for around two years and all of a sudden this slowness began to happen.

It’s not about the image sizes, in case you’re wondering. I checked and all images are around 100kb.

I first though it was a server problem, so I tried loading a large image by going directly to its URL and it loaded in no time. Also server response through FTP is pretty fast.

The only odd thing I’ve managed to find is that by accident I had left the debug option in config.php set to true. When I switched it to false, the panel stopped loading at all, with a “This site can’t be reached” message from the browser. The frontend still loads but speed is the same.

I’m using Kirby 2.3.2. Would it help to update?

I’m not getting any PHP or Javascript errors reported. How can I even tackle this? I’m lost. :frowning:

Do not switch to false but remove the config entry.

If you want to keep the debug option for localhost, you can create different config.php files for different environments.

I see. OK, this allowed me to enter the panel without leaving debug mode on. But speed is the same.

Tried updating to 2.4.1 and the slow loading persists in both panel and frontend.

Do all pages on the frontend and in the panel load slowly or only specific ones?

Yes, all. :confused:

I would assume that it is rather a server problem than a Kirby problem, if you haven’t changed anything. Or has the site grown considerably in size since it was first installed? Do you have pages with thousands of subpages?

No, nothing has grown massively in size, just a few new pages, but we’re talking about maybe 60-70 pages in the course of the past two years. Only two levels of depth, nothing fancy.

It happened in the past that a page that was linked to another by it’s UID, changed name/UID and thus the code couldn’t find it anymore and the whole site and panel went down because of that. I’m more concerned it could be something like that, because of something being badly programmed (I’m a self-taught programmer) and not checking before executing some functions. But this time there’s no errors involved or pages not loading. It’s just slow.

How can I rule out the possibility of it being a server issue?

First of all I would download it to a local server and check how it works there. Then maybe test on another remote server.

Will try that. Thanks!

Yeah, let me know your findings.

Oh yes, it’s really important to make this a habit. Because more often than not, everything works fine as long as it is under your control, but comes the time the user does something unexpected, things start to break.

Forcing PHP version 5.6 with AddHandler php56-fcgi .php on .htaccess seemed to solve the problem of the slowness completely.

Anyway, before the site was running on PHP 5.4.45, which is above of Kirby’s requirements (PHP 5.4+). It might have been just a coincidence, I don’t know, but the site was slow for over a week, and it went back to normal speed right after I edited the .htaccess. Weird.

I haven’t have the time to test that same installation in localhost nor in a different server, so I can’t report on that, sorry!

Ok, I’ll mark this as solved for the moment.