rewrite update cache