TSHTTPTXNP...TIONURLSET(3ts)
π 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 URLTSHttpTxnParentSelectionUrlGet()β 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 π
π COPYRIGHT π
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
- ubuntu questing: trafficserver-dev 9.2.5+ds-1ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms