It really depends on how you have structured your database and code.
There are areas of the software that we manage caching independently of the rest of the suite, and when we do this, we typically store the data like so:
\IPS\Data\Store::i()->yourDataKey = [ 'time' => time(), 'data' => [ ... your data here ... ];
Then when reading you can check 'time' against the current time and make a decision as to whether to use the data or refresh it.
For an example of this, check out /system/Widget/Widget.php, around line 879