---
name: "TSHttpTxnIsCacheable"
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/TSHttpTxnIsCacheable"
---

# TSHttpTxnIsCacheable(3ts)

TSHttpTxnIsCacheable API function

## NAME

TSHttpTxnIsCacheable - TSHttpTxnIsCacheable API function

## SYNOPSIS

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

- ***TSReturnCode* TSHttpTxnIsCacheable(*TSHttpTxn* txnp, *TSMBuffer* request, *TSMBuffer* response)**

  ## DESCRIPTION

Determine if an upstream response is cacheable according to the current Traffic Server configuration and state. All of the arguments must have be obtained via other API calls prior to calling this function.

The *request* and *response* arguments must refer to HTTP header objects. These are treated as the request and response for a transaction respectively. Based on the transaction state from *txnp* and the contents of the request and response, this returns **TS\_SUCCESS** if the response is cacheable, **TS\_ERROR** otherwise.

## COPYRIGHT

2026, dev@trafficserver.apache.org
