cache: restore flagging entries written into cache

This was probably lost during the cache backend rewrite in 2.x

fixes #332
18 jobs for cache-write-interface
in 8 minutes and 19 seconds and was queued for 17 seconds