Add cache to enhance performance.
Update log.