commit befor invalidating cache