store cache before installing instead of loading after installation

Signed-off-by: Gerald <gera2ld@163.com>