Why doesn't the tryAddCacheEntryFromData just return a type enum value, and "Unknown" if it could detect the type (and therefore hasn't added the entry).  That way there'd be no need for the multiple tryAdd.. calls.