Cache Remote requests?

I’m reading through Content from an API and I’m curious how to handle caching while using Remote to avoid hitting API limits.

Is caching handled by Kirby automatically for Remote::get()? If so, how long is the response cached by default?

If it’s not handled by Kirby or the web server (nginx), how would I set up caching for a response? I’m assuming I’d need to write the response to a file, read it, and refetch it after an interval. I have to admit I’m learning PHP at the same time here :sweat_smile:

No.

See Caching | Kirby CMS

Example code also here: Virtual Pages with API and Caching - #8 by rasteiner

1 Like

Thank you so much for the prompt response! $cache->getOrSet() is excellent.