update cache first