Validate cache directory.