This is in response to discussions on IRC and TS-3426. This would replace all 
of the current API functions to control cacheability.

TSHttpTxnCacheablility
======================

Synopsis
------------

`#include <ts/ts.h>`

.. c:function:: TSHttpCacheability TSHttpTxnCacheabilityGet(TSHttpTxn txnp)
.. c:function:: TSReturnCode TSHttpTxnCacheabilitySet(TSHttpTxn txnp, 
TSHttpCacheabillity value)

Control the cacheability of a transaction.

Description
---------------

Setting this value to something other than `TS_HTTP_CACHEABLE_DEFAULT` 
overrides any other setting or property of the transaction.

The valid values are

`TS_HTTP_CACHEABLE_ALWAYS`
   Cache the transaction if possible to store in the cache. Essentially this 
means if the request and the response are valid HTTP it will be cached.
`TS_HTTP_CACHEABLE_NEVER`
   Do not cache transaction.
`TS_HTTP_CACHEABLE_DEFAULT`
   Ignore this setting. Determine cacheablity according to the transaction and 
other settings.

The iniital value is `TS_HTTP_CACHEABLE_DEFAULT`.

For finer grained control it is expected the plugin will examine the relevant 
parts of the transaction and call this
with the appropriate value to override the normal processing as desired. This 
must be called from the
`TS_HTTP_READ_REQUEST_HDR_HOOK` to the `TS_HTTP_READ_RESPONSE_HDR_HOOK` hooks 
inclusive. After that the cache operation
will have either started or can no longer be started.

Reply via email to