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

# TSHttpTxnIsInternal(3ts)

test whether a request is internally-generated

## NAME

TSHttpTxnIsInternal - test whether a request is internally-generated

## SYNOPSIS

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

- **int TSHttpTxnIsInternal(*TSHttpTxn* txnp)**

  - **int TSHttpSsnIsInternal(*TSHttpSsn* ssnp)**

  ## DESCRIPTION

*TSHttpTxnIsInternal()* tests whether a HTTP transaction was originated within Traffic Server.

*TSHttpSsnIsInternal()* tests whether a HTTP session was originated within Traffic Server.

## RETURN VALUES

Both these APIs return a **int**, indicating whether the request was internal (**1**) or not (**0**).

## EXAMPLES

The ESI plugin uses *TSHttpTxnIsInternal()* to ignore requests that is had generated while fetching portions of an ESI document:

```
  if (obj_status == TS_CACHE_LOOKUP_HIT_FRESH) {
    TSDebug(DEBUG_TAG, "[%s] doc found in cache, will add transformation", __FUNCTION__);
    return isTxnTransformable(txnp, true, pOptionInfo, intercept_header, head_only);
  }
```

## SEE ALSO

**[TSAPI(3ts)](/TSAPI/3ts.md)**

## COPYRIGHT

2026, dev@trafficserver.apache.org
