Kevin
Well-known member
Is there a best practice, or at least a current recommended way, of caching finder results?
There are two places where I'd like to cache finder results; first for displaying results in a widget and then on it's own route for displaying the full results paginated. The add-ons in question are already up & running and I've got the widgets working fine and the dedicated route pages are working fine, I'm just working on cleaning up the code a bit and would like to explore caching options.
There's the below from @Ralle; is that or similar what other folks are using?
There are two places where I'd like to cache finder results; first for displaying results in a widget and then on it's own route for displaying the full results paginated. The add-ons in question are already up & running and I've got the widgets working fine and the dedicated route pages are working fine, I'm just working on cleaning up the code a bit and would like to explore caching options.
There's the below from @Ralle; is that or similar what other folks are using?
XF 2.0 - Caching finder results
I wrote a neat little function that allows you to fetch from a finder, but only if it is not cached. class Util { public static function cachedFinderFetch(\XF\Mvc\Entity\Finder $finder, $cacheKey, $lifeTime = 0) { $app = \XF::app(); $em = $app->em(); $cache =...
xenforo.com