Avoid cache colision for complex file structures

Better names for cache files to avoid cache collision when using complex file structures and repeated file names in different directories.