Improve the cache system for Loop