Caching an API call

Hey there,
I’m using this one from the docs:

$response = remote::get('https://baseurl.com', [
  'data' => [
    'param' => 'val'
  ]
]);

Now, I want to cache $response and only call it again if its cached version is older than x hours. How may I utilise Kirby’s cache system to do that?

Thx!

Have a look how to use the cache system in this plugin: https://github.com/kirby-deprecated-plugins/kirby-time-cache

So, easiest would be to use this plugin to cache 1. my remote call or 2. the whole page containing my $response for x hours, saving all the hassle of copying relevant functions to my own setup, right?

Probably, but I haven’t inspected the plugin’s source code

Thanks so far! Wish this would be Kirby core behaviour, just saying ‘query x, read / write cache after y period’