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

# TSHttpTxnCacheLookupUrlGet(3ts)

TSHttpTxnCacheLookupUrlGet API function

## NAME

TSHttpTxnCacheLookupUrlGet - TSHttpTxnCacheLookupUrlGet API function

## SYNOPSIS

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

- ***TSReturnCode* TSHttpTxnCacheLookupUrlGet(*TSHttpTxn* txnp, *TSMBuffer* bufp, *TSMLoc* offset)**

  ## DESCRIPTION

Get the current cache key URL, also referred to as the lookup URL. This must be stored in a properly allocated URL object, typically created with a *TSUrlCreate()*.

## TSHTTPTXNCACHELOOKUPURLSET

### Synopsis

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

- ***TSReturnCode* TSHttpTxnCacheLookupUrlSet(*TSHttpTxn* txnp, *TSMBuffer* bufp, *TSMLoc* offset)**

  ### Description

Set the current cache key URL, also referred to as the lookup URL. This must be stored in a properly allocated URL object, typically created with a *TSUrlCreate()* or *TSUrlClone()*.

This API can be called as early as **TS\_HTTP\_READ\_REQUEST\_HDR\_HOOK** but no later than **TS\_HTTP\_POST\_REMAP\_HOOK**. This is the preferred and most efficient way to modify the cache key, but an alternative is to use the old *TSCacheUrlSet()*, which takes a simple string as argument.

## COPYRIGHT

2026, dev@trafficserver.apache.org
