MyBB Hacks

Full Version: PreParser Cache (beta)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 Tongue).

(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)
[attachment=69]

Older versions[attachment=2](note, contains premodified 1.2.11 files)
Having run this on my board for a while, I've only encountered two bugs with this, both of which have been fixed in this 1.0 update.
I Will try this soon, Thanks Zinga

I´m using Media Temple and in the CPU Report usage "showthread.php" uses more than 40% of my Resources...
is it works on 1.2.12 too?
Yeah, the update also has pre-modified 1.2.12 files.

I think I forgot to update the first post with the info though...
thx again zinga... you r realy amazing...
could you please update this to mybb 1.213 Zinga..

Thanks
(06-04-2008 10:21 PM)AglioEoliO Wrote: [ -> ]could you please update this to mybb 1.213 Zinga..

Thanks
Just apply the 1.2.13 patch to the existing pre-modified files - it shouldn't take long...
whats are modifies? or is pre-modified file will work on 1.2.14 ?
Work?  Probably, but I wouldn't recommend it because you'll probably lose the modifications made in 1.2.14...
Reference URL's