tasianmedia / getYoutube

A simple video retrieval Snippet for MODX Revolution
http://modx.com/extras/package/getyoutube
4 stars 5 forks source link

Cache API calls or results #21

Open wallacio opened 4 years ago

wallacio commented 4 years ago

Thanks for writing this plugin, it's going to save me a bunch of time.

This might be more of a generic MODX question but I'm wondering about the possibility of caching results to minimise unnecessary API calls (thinking of both efficiency and expense). Typically, the playlist I'm going to read doesn't change very often so there's little merit in a real-time API call to YouTube.

I suppose it'd be nice to have a cache parameter - either leveraging the MODX cache for the snippet itself, or caching the API results. The latter probably means storing the result from the API request in a table which adds complexity.

Is there an obvious solution to this that I'm missing?

davidpede commented 4 years ago

Thanks glad you find it useful!

Nothing built in but will look at adding in future release.

In the meantime https://github.com/opengeek/getCache/wiki/Usage should cover what you want todo