Did you know that you can use Kirby's built-in cache for your custom data as well?
$cache = kirby()->cache()->get('your.cache.key');
if($cache) return $cache;
// get the value
kirby()->cache()->set('your.cache.key', $value, $minutes);
Of course the cache needs to be enabled for this to work.