I have not yet tried this code from Mike Ash, however, his background timer
MABGTimer appears to be quite useful for clean up tasks both of internal data structures, caches and server synchronization. I especially like the thought of using this code in conjunction with a cache of networked data.