fix a bug in fingerprint_cache; optimize optimal cache