MyBB Community Forums

Full Version: Speed up showthread with signature cache
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Normally in myBB every time a thread is loaded every post with a signature must be parsed. Every time a post with a signature comes along mybb sends the un-parsed signature to the postify function and runs multiple replace calls for bbcode, smiles, etc.

If a user posts in a thread two or more time, myBB will send the un-parsed signature to postify each time it shows up.

With my hack installed once a sig is parsed it is saved in an array. As myBB loops over the posts and postify's them one by one it can look at this array and make sure it has not already parsed a users sig.

If it has already parsed the sig it uses the saved sig stored in the temporary array, otherwise it will send the sig to postify, and save the output for use at a later time.

Generation times will drop with this hack, more so for boards with high post per page settings or users that like to double post a lot.

I uploaded a new version of this hack to the first post. This one prevents anyone from passing makepostbit a fake sig cache.

If you installed the first version, download the new attachment and do the edit to showthread.php only Smile
Whoever has the first post to have a sig will generate the same sig for everyone that DOESN'T have one. Then, if another user has a sig, it will keep showing up for the next users that doesn't have a sig.