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.
<?php 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; }
Our logic becomes cleaner:
<?php function your_data_provider() { return your_logic(); } $data = at_cache( array('id' => '…', 'bin' => 'cache', 'ttl' => '+ 15 minutes'), 'your_data_provider' );