Cache: cache

Review Request #528 — Created Aug. 14, 2017 and submitted — Latest diff uploaded

p.valk
Lunr
cache2
2a326cb...
lunr

psuedocode example of how to implement it inside a controller.

public function foo()
    {
            $key = 'some unique identifier';

            $cache = new cacheprovider(...);

            $values = $cache->get($key);

            if ($values === FALSE)
            {
                $values = $api->get_entries($type, $filter);

                $cache->set($key, $values);
            }
        }

        // Return data.
        return $values;
    }


Loading...