cache: fix host length calculation