Caching of commit_matrices into files.