Our site uses the Vimeo PHP library (
https://github.com/vimeo/vimeo.php).
Currently I'm calling the library within snippets, e.g.:
require_once("____/autoload.php");
$vimeo = new \Vimeo\Vimeo(____AuthKeys, etc.___);
...
$videos = $vimeo->request('/me/albums/____)['body']['data']
...
But this means way more calls to the API than necessary ... right?
Vimeo recommends caching the response, but I'm not sure how to do that in modx.
I'm guessing the first 3 lines only need to be run once, then cached ... until we make changes to our Vimeo account (add videos, albums, etc.)
What's the best way to accomplish this?
The only part that changes from snippet to snippet is the `$vimeo->request...` portion ... is there a way to only have that at the start of our snippets?