[Cache API] Optimize whitespace trimming in Vary header values