Hello,
I wonder if there’s an easy way to cache a query result in a plugin I’ve written? It goes to another website to check an API, so I would like to have a way of caching this result, so that it only checks every 10 mins or so.
I’ve been looking at the Magpie plugin, which has some caching built in, but I wondered if there’s a way of harnessing EE’s built in ability to cache things?
This is different from the $SESS->cache setup, which, of course, only caches things on a particular page load.
Any pointers gratefully received.
Moved to Plugins: Technical Assistance by Moderator
There is no conveniently abstracted way to do this, but there are a bunch of plugins out there that already do this. Take a look at the _check_cache and _write_cache methods in this file. They should be pretty easily modified to fit your needs.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.