lock when writing cached assets