This modification does a number of things:
- Cache preparsed versions of posts.
- Cache preparsed versions of signatures.
- Hard replace topic titles (I personally see little reason why "soft"-copies should be kept...)
For those who may not understand what this does, basically, the parser is what turns MyCode into HTML. However, if you have a large number of smilies and/or custom MyCodes, the parser obviously has to do more work, replacing stuff in posts.
MyBB's parser is run every time someone views the post. That means, on a thread with about 10 posts, the parser has to go through 10 posts and parse each one.
This modification aims to lessen the load from the parser, by storing preparsed versions of posts in the DB.
How much this increases the speed of your board (primarily showthread.php) will depend probably on quite a number of factors.
I've tried to make this work as fast as possible though - preparsed messages are fetched via joins, so no extra queries are performed. Updates are performed via similar techniques as updates are performed in my MyPlaza plugin - all updates are cached, and committed to the DB via a single REPLACE INTO query (for each posts and signatures) at shutdown, to make things as fast as possible (and also won't break if the user cancels loading the page
).
(Just FYI, the preparser cache is installed on these boards)
In this plugin, you can specify how long posts/signatures are kept in the cache.
I haven't had much chance to test this out, but it appears to be working fine here.
Due to the nature of how this works, a large number of code edits is required. Pre-edited MyBB 1.2.12 files are included for convenience.
Installation isn't too difficult (if you haven't modified any files yet) - just upload the contents of the
/inc folder to the inc folder in your forum installation directory. Next, just upload the contents of the
/premodified folder to the root of your forum installation directory. Finally activate the plugin in the AdminCP.
Please feel free to ask any questions, report any bugs, provide suggestions or give any comments. Thanks!
Update: 1.0
- Fixed /me glitch
- Fixed glitch involving multiple concurrent updates (ie multiple people posting at the same time)
preparser10.zip (Size: 91.86 KB / Downloads: 1075)
Older versions preparser.zip (Size: 86.68 KB / Downloads: 1010)(note, contains premodified 1.2.11 files)