$cache = Gdn::cache(); $myVar = 'This is my variable'; $cache->store('myVar', $myVar, 3600); // store for 1 hour
$cache = Gdn::cache(); $myVar = $cache->get('myVar'); if ($myVar === null) { $myVar = 'This is my variable'; $cache->store('myVar', $myVar, 3600); // store for 1 hour }
$cache = Gdn::cache(); $cache->delete('myVar');Package Library: The PHP Gdn Cache is a part of the Vanilla Forum software package library, which includes other libraries for building web applications using PHP. The library is included in the Vanilla Forum software and can also be downloaded separately for use in other PHP applications.