MyBB Community Forums

Full Version: Cache data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I guys,
there a method in MyBB to cache data to avoid to connect to db every times?
(08-08-2016, 08:05 AM)chack1172 Wrote: [ -> ]I guys,
there a method in MyBB to cache data to avoid to connect to db every times?

Yes, MyBB has a cache class. I'm not sure if you mean to use the cache in a plugin? If so, it's fairly simple to use and the code can be found here: https://github.com/mybb/mybb/blob/featur...acache.php

global $cache;

$data = $cache->read('someKey');

// Storing data:
$cache->update('someKey', 1234);
Thank you @Eaun T, I knew that MyBB had this class but I didn't know how to use it