Build cache code