update cache in _write_cache

Signed-off-by: Thiago Rondon <thiago.rondon@gmail.com>