A good cache system for temporary files really needs to be implemented at the system level, not at the application level. This way the system can clean up temporary files of all types from all applications when space is running low. The system should use all of the remaining unused space available for temporary files. I wasn't kidding when I created this image of cache settings. To ensure that users don't get worried about low disk space, the system should ignore the cache when calculating the total free disk space. For instance, if normal files are occupying 60% of available space, and temporary files 38%, the system will still report that there is 60% of the space free. Actually, memory caching should be done the same way.