How to work with the cache
Hello, I'm creating a module and I've encountered some issues with caching (this is my first time dealing with it). I have $xml which I parsed and stored everything necessary in the variable $res. (Or would it be simpler to just put everything in a block and cache that block?)
Right now, I need to store it in the cache (updating it every 6 hours) and retrieve it upon request.
I know I need to look into
But I'm not quite getting how to store it.
As I understand, this code stores data in the cache, but where do all these variables go... where do I insert my variable?
cache_set($cid, $data, $bin = 'cache', $expire ='CACHE_PERMANENT')
To retrieve from the cache
cache_get ($cid, $bin = "cache")
and for updating, I can't figure out how to use hook_cron.
Please advise me regarding my problem. Thank you in advance.