This new API is the inverse of an existing API, TSHttpTxnCacheLookupUrlGet(). 
It also works similar to another existing API, TSCacheUrlSet(). The main 
difference between this new API and TSCacheUrlSet() is that we work on normal 
URL objects. This can in some cases avoid unnecessary string conversion + 
string parsing -> URL that happens with TSCacheUrlSet().

This new API has the prototype

        TSReturnCode TSHttpTxnCacheLookupUrlSet(TSHttpTxn txnp, TSMBuffer bufp, 
TSMLoc obj);


The typical usage for this API is to modify the cache-key as used by the core. 
As such, it should work identical to TSCacheUrlSet(), except it avoids the 
string creation / parsing phase.


The related Jira is TS-3555. There is no ABI / API incompatibility here, since 
this is a new API. Docs “diff” is attached below.

Cheers,

— leif


+TSHttpTxnCacheLookupUrlSet
+==========================
+
+Synopsis
+--------
+
+`#include <ts/ts.h>`
+
+.. c:function:: 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
+:c:func:`TSUrlCreate()` or :c:func:`TSUrlClone()`.

Reply via email to