Introduce locking on cache