TSHTTPTXNP...TIONURLSET(3ts)

πŸ“¦
version 9.2.5 Β· 5 versions
, in ubuntu questing

πŸ’– NAME πŸ’–

TSHttpTxnParentSelectionUrlSet β€” the traffic Server Parent Selection consistent hash URL manipulation API. yes that's a whole mouthful bestie, we're getting into it together 🫢


✨ SYNOPSIS ✨

#include <ts/ts.h>

TSReturnCode TSHttpTxnParentSelectionUrlSet(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc offset)

TSReturnCode TSHttpTxnParentSelectionUrlGet(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc offset)

🌸 DESCRIPTION 🌸

okay so. the Parent Selection consistent hash feature picks which parent cache you're gonna talk to by hashing a URL β€” specifically the URL from the HTTP request header. that's the whole vibe. πŸ‘‘

these API functions let you define an over-ride URL, and when you do, the over-ride URL gets hashed instead of the normal (header request) URL. periodt. also super important: any filtering options that could get applied to the normal URL (like qstring) are NOT applied to the over-ride URL, because the assumption is that you already did your custom filtering yourself before you explicitly set the over-ride URL. it's giving "you handled it, so we're not gonna double-handle it" πŸ’…

now the tea πŸ“ β€” the normal URL is only hashed on the path and query string portion (which you can optionally exclude with the qstring option). but the over-ride URL? that one is hashed on the entire URL string as returned by URL::string_get_ref(). so yeah, that includes the scheme and hostname like http://hostname, which show up before the path. lowkey a big difference, don't sleep on it 😭

so if the non-path URL elements shouldn't get hashed in any meaningful way, you should either:

  • normalize them to some value β€” do this if they're actually required for a valid URL
  • exclude them β€” do this if they're optional

...when you're generating the over-ride URL. for example, since the over-ride URL is arbitrary anyway, you can literally just set the URL scheme and hostname to fake://fake.fake when you're creating the over-ride URL. iconic workaround, no cap ✨

  • TSHttpTxnParentSelectionUrlSet() β€” sets the over-ride URL
  • TSHttpTxnParentSelectionUrlGet() β€” gets the over-ride URL

πŸ’€ RETURN VALUES πŸ’€

all of these APIs return a TSReturnCode, which tells you whether the operation succeeded (TS_SUCCESS) or failed (TS_ERROR). that's it, that's the whole check. go look at it, bestie, don't just assume 🫢


πŸŽ€ SEE ALSO πŸŽ€


2026, dev@trafficserver.apache.org


and that's the whole page, bestie!! πŸ¦‹ this one's from 9.2, dated Feb 12, 2026, out of the TSHTTPTXNP...TIONURLSET(3ts) manual β€” go hash something cute, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from