Only cache when cache repository is available.

Signed-off-by: crynobone <crynobone@gmail.com>