Improve cache management in autoloader.