---
name: "TSCacheRead"
section: "3ts"
platform: "linux"
package: "trafficserver-dev"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/TSCacheRead"
---

# TSCacheRead(3ts)

TSCacheRead API function

## NAME

TSCacheRead - TSCacheRead API function

## SYNOPSIS

```
#include <ts/ts.h>
```

- ***TSAction* TSCacheRead(*TSCont* contp, *TSCacheKey* key)**

  ## DESCRIPTION

Asks the Traffic Server cache if the object corresponding to *key* exists in the cache and can be read.

If the object can be read, the Traffic Server cache calls the continuation *contp* back with the event *TS\_EVENT\_CACHE\_OPEN\_READ*. In this case, the cache also passes *contp* a cache vconnection and *contp* can then initiate a read operation on that vconnection using *TSVConnRead*.

If the object cannot be read, the cache calls *contp* back with the event *TS\_EVENT\_CACHE\_OPEN\_READ\_FAILED*. The user (*contp*) has the option to cancel the action returned by *TSCacheRead*. Note that reentrant calls are possible, i.e. the cache can call back the user (*contp*) in the same call.

## COPYRIGHT

2026, dev@trafficserver.apache.org
