Good Morning all,
We carried the upgrade of Expression Engine from v 2.9 to 6.0.1, after a few addons upgrades, the website was running fine. One funny thing, is that, if we are logged in on the website everything runs quick and works like a charm, but if a no logged user clicks (site visitor) through the website it takes an average of 10 seconds to open any page.
We have cleared cache, checked folder permissions, optimize tables, check all addons again, but no luck.
From what it seems, if you are logged in as super admin the number of queries to the database is an average of 50 simultaneous queries, whilst for a no logged user, it does an average of 300 queries to the database when you open a simple page. Does anyone else has incurred the same issue?
We are running out of clues here.
Thank you,
Kind Regards,
My suggestion is this: Duplicate the template that is slow so you can mess with it without disrupting your live page. Then, through a process of elimination narrow it down to the code causing the slow-down. I suspect you might be running EE tags inside other EE tags which can cause a lot of queries if you’re not careful.
Thank you for your reply.
I don’t believe It isn’t actually related to a specific template, as the slowness is noticeable for all pages. Additionally, if I suppose if it was an issue with the templates, that would actually also noticeable for SuperAdmins.
As mentioned in my initial comment, for SuperAdmins the website is working fantastic well, quick and responsive. For the guests/visitors, takes at least 10 seconds to open those pages.
Update:
It was actually EE6 legacy\libraries\Template.php -> fetch_template(), more specifically model\Template\Template.php. Let me explain, fetch_template is validating all templates user has access to (which doesn’t occur if you are a superadmin) and when it retrieves all the templates that the user has access to it triggers Template.onAfterLoad (from FileSyncedModel) which then triggers one call per template to the DB. At first sight, seems to be an issue with EE6 itself, but it could also be some setting/ configuration on our side that is triggering this behaviour.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.