We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Without at_cache()
function your_data_provider($reset = FALSE) { $cache_id = '…'; $bin = 'bin'; $expire = strtotime('+ 15 minutes'); if (!$reset && $cache = cache_get($cache_id, $bin)) { return $cache->data; } $data = your_logic(); cache_set($data, $cache_id, $bin, $expire); return $data; }
With at_cache(), your logic becomes cleaner:
function your_data_provider() { return your_logic(); } $data = at_cache(array('cache_id' => '…'), 'your_data_provider');