XF 2.1 Custom Cache

Cupara

Well-known member
I'm trying to create a custom cache for my add-on that will store a token for 86399 then a cron will run to update it with a new token after that time. Unless I should store it in the database. I'm not sure honestly. I'm not even sure where or how to start coding the cache.
 
Am I able to use SimpleCache to store an array of values such as the value and expiry value?

I discovered that a TTL can be set, the question is after I set it like so:
PHP:
$app->simpleCache()->getSet('GoblinTimes/xenWoW')->setValue('battle_net_token', $array['access_token'], $array['expires_in']);

How do I check if it is expired?
 
Last edited:
Back
Top Bottom