configfile: cache unique keys based on opts

this is a potential idea for solving #797