Large $page variable?

Hello, all.

My website has been running slow for a while, but I’ve been attributing that to living where the internet is unreliable and bad. Having recently arrived back to my house where the internet is slow, I notice that my website is still slow.

Slow as in: 40 seconds TTFB.

I decided to try the var_dump($page) debugging as suggested in the kirby docs. The blob of information is so large my text editor hangs when I try to scroll through it. My web browser is unable to “show source code” without hanging. When I finally managed to save the page as an HTML file I found it was 50MB.

Something told me this wasn’t right, :dizzy_face: It seemed that every post and page and image had it’s own entry, even though none of that was used. I discovered the “scan for css files and js files in post pages and add them to the header” script, and when I took that out, the source code save was only 21.4 MB.

How big should the $page variable be? (Or the $site) variable be for that matter? I know it’s probably different for each site, but is there a target size? Or a “this is always too big” size?

Thanks a bunch.

What Kirby version are you using? If you are using a version below 2.4.0, Kirby objects can in fact be very big because they contain a lot of recursive information. That has changed since Kirby 2.4.0.

1 Like

It looks like I’m using 2.3.1. I think it’s time to upgrade and maybe rewrite things from the ground up.

My initial download and test of 2.5.1 works great… at least on the homepage. Clicking to any other page just goes into an endless loading mode. (Works fine on my local xxamp install.)

Yeah, definitely time to start from scratch. Clean things up a bit.

You might have to set the RewriteBase to ‘/’ or - if you have installed Kirby in a subfolder - to that subfolder in your .htaccess for subpages to work, depending on your environment.

There is currently a bug in 2.5.1 where user creation via the Panel fails, but this bug is has been solved on the dev branch (only relevant if you are using the Panel).