MyBB Community Forums

Full Version: How to cache a template in plugin if not cached by author?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to fix some of the plugins I have and get fewer queries by caching uncached templates.

What is required to do and manually cache those?
Try to take a look at hello world plugin approach: inc/plugins/hello.php#L17
Almost believed this gonna work but it didn't :/

Tried like this at top to cache uncached templates in plugin which is shown on index.
if(defined('THIS_SCRIPT'))
{
    global $templatelist;
    if(isset($templatelist))
    {
        $templatelist .= ',';
    }
	if(THIS_SCRIPT== 'index.php')
	{
		$templatelist .= 'index_sidebar_reputation,index_sidebar_post,index_sidebar';
	}
}
Try using global_start hook.
(2019-06-04, 11:14 AM)effone Wrote: [ -> ]Try using global_start hook.

yes, that works!

But why global_modqueue_notice is not cached?