Prevent race conditions, init cache first