The coders, who uses vB4 and know how nice the cache is, don't need to miss it in XenForo.
I love the cache, because it uses a timeout AND you can have Tags/Events on which tyou can delte the Cache Entries.
If you want to show the 10 newest users/threads/posts/whatever on your indexpage, you have huge queries, which run on every index view.
So what can we do, to save the queries?
We can cache the result.
Now if you use the cache you would use:
$cache = XenForo_Application::get('cache'); $data = array('foo','bar'. 'tap'); // my results;) $cache->save($data, 'myId');
BUT why renew the cache element, if the cache content didn't change?
For this, you can use the Cache Tags (for former vB Add-on Coders => cache events )
$data = array('foo','bar'. 'tap'); $cache->save($data, 'meineragtekid', array('newthread_created', 'thread_deleted') );
That's important, because i want the box "up2date" so i have to "empty the cacheelements" when somebody creates,edits or deletes a thread.
To make this, we have now to empty the defined tags after creating a thread.
That's a "article" about caching, so i don't want to explain here, how to expant the thread datawriter to make this
This is just a quick example, but i hope you enjoy and use it
(Sorry for my bad english, i hope you understand it^^ )