diff --git a/include/ts/ts.h b/include/ts/ts.h index 3db56376fb2..a58ccbdf013 100644 --- a/include/ts/ts.h +++ b/include/ts/ts.h @@ -1291,6 +1291,13 @@ tsapi void TSHttpTxnReqCacheableSet(TSHttpTxn txnp, int flag); */ tsapi TSReturnCode TSHttpTxnServerRespNoStoreSet(TSHttpTxn txnp, int flag); +/** Get flag indicating whether or not to cache the server response for + given TSHttpTxn + @param txnp The transaction whose server response you do not want to store. + + @return TS_SUCCESS. +*/ +tsapi bool TSHttpTxnServerRespNoStoreGet(TSHttpTxn txnp); tsapi TSReturnCode TSFetchPageRespGet(TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset); tsapi char *TSFetchRespGet(TSHttpTxn txnp, int *length); tsapi TSReturnCode TSHttpTxnCacheLookupStatusGet(TSHttpTxn txnp, int *lookup_status); diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc index b574f1d31e7..75fb418d361 100644 --- a/src/traffic_server/InkAPI.cc +++ b/src/traffic_server/InkAPI.cc @@ -5247,6 +5247,15 @@ TSHttpTxnServerRespNoStoreSet(TSHttpTxn txnp, int flag) return TS_SUCCESS; } +bool +TSHttpTxnServerRespNoStoreGet(TSHttpTxn txnp) +{ + sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS); + + HttpTransact::State *s = &(((HttpSM *)txnp)->t_state); + return s->api_server_response_no_store; +} + TSReturnCode TSHttpTxnServerRespIgnore(TSHttpTxn txnp) {