Add utility to load files from cache (#980)
* Add utility to load files from cache
* Deal with repo type
* Apply suggestions from code review
Co-authored-by: Lucain <lucainp@gmail.com>
* Address review comments
Co-authored-by: Lucain <lucainp@gmail.com>