I have a 'template_setup' listener to create a custom template function.
Part of the logic of this function fetches phrases to build a specifically generated string. I am seeing that, in cases where this function is used, this is generating a high number of phrase queries that is being maintained (there are cases where I use the fuction through a template, and cases where I return the results of the function through my code).
It is my understanding that unknown phrases would be fetched (and this would explaining a high query count on an initial page load), only to drop back down once the phrases had been. But the phrases being referenced are XF stock phrases - they should surely be known already, and should they be being fetched consistently?
(I am also not seeing one query to fetch the phrases, but rather 14 queries for each phrase title.)
Part of the logic of this function fetches phrases to build a specifically generated string. I am seeing that, in cases where this function is used, this is generating a high number of phrase queries that is being maintained (there are cases where I use the fuction through a template, and cases where I return the results of the function through my code).
It is my understanding that unknown phrases would be fetched (and this would explaining a high query count on an initial page load), only to drop back down once the phrases had been. But the phrases being referenced are XF stock phrases - they should surely be known already, and should they be being fetched consistently?
(I am also not seeing one query to fetch the phrases, but rather 14 queries for each phrase title.)
SELECT title, phrase_text FROM xf_phrase_compiled WHERE language_id = ? AND title IN ('a')
SELECT title, phrase_text FROM xf_phrase_compiled WHERE language_id = ? AND title IN ('b')