optimize cache management