test and update cache