Generating cache from a directory