Add cache_last_entry option, and optimized caching access time and logic.