Caching a variable for a fixed amount of time
yes there is a native function cache_set

&lt;?php
cache_set('my_module_data', $my_data, 'cache', time() + 360); 
?&gt;


here is a great tutorial about caching in drupal