TSCACHEREAD(3ts)

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

✨ TSCACHEREAD πŸ’…

okay bestie, sit DOWN, because we're talking about the Apache Traffic Server man page TSCACHEREAD(3ts) and honestly? it's giving cache girlie energy and I'm obsessed. πŸŽ€


🌸 NAME 🌸

TSCacheRead β€” it's the TSCacheRead API function, periodt. that's the whole name. iconic of it honestly. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

so first things first, you gotta pull in the header, no cap:

#include <ts/ts.h>

and then, the moment you've been waiting for, the function signature itself, copy it EXACTLY bestie:

TSAction TSCacheRead(TSCont contp, TSCacheKey key)

two args, one return, zero drama. ✨


πŸ’– DESCRIPTION πŸ’–

okay so what does it do? TSCacheRead literally just asks the Traffic Server cache a yes/no question: "hey, does the object that matches key exist in the cache, and can it be read?" that's it. that's the vibe check. 🫢

now here's where it gets spicy, because there are two possible outcomes and you need to know both, fr fr:

  • it CAN be read β€” the Traffic Server cache calls the continuation contp back with the event TS_EVENT_CACHE_OPEN_READ. and in that case, the cache ALSO hands contp a cache vconnection, and then contp can go ahead and kick off a read operation on that vconnection using TSVConnRead. slay. πŸ”₯
  • it CANNOT be read β€” the cache calls contp back with the event TS_EVENT_CACHE_OPEN_READ_FAILED instead. and here's your little out: you, the user (aka contp), have the option to cancel the action that TSCacheRead returned. so like, you're not trapped. πŸ’…
⚠️ okay but this next bit is IMPORTANT bestie, don't skip it: reentrant calls are possible β€” meaning the cache can call the user (contp) back in the same call. like, mid-call. same stack, same breath. so don't be out here assuming your callback only ever fires later, because she can show up immediately. πŸ˜­πŸ’€

2026, dev@trafficserver.apache.org β€” go give the devs their flowers, they earned them. πŸ’


and that's the whole page, bestie!! no notes. this was Apache Traffic Server, version 9.2, dated Feb 12, 2026, and honestly? she ate. bye babes, go read your cache responsibly πŸ¦‹πŸ’œβœ¨

πŸ“¦ where this page comes from