You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2014/02/05 23:30:12 UTC

[jira] [Commented] (TS-1622) Add an API to query if a response header would be cacheable

    [ https://issues.apache.org/jira/browse/TS-1622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13892659#comment-13892659 ] 

Leif Hedstrom commented on TS-1622:
-----------------------------------

I'd like to propose this API addition:

{code}
  /**
    Test whether a request / response header pair would be cacheable under the current
    configuration. This would typically be used in TS_HTTP_READ_RESPONSE_HDR_HOOK, when
    you have both the client request and server response ready.

    @param txnp the transaction pointer
    @param request the client request header. If NULL, use the transactions client request.
    @param response the server response header. If NULL, use the transactions origin response.

    @return 1 if the request / response is cacheable, 0 otherwise
  */
  tsapi int TSHttpTxnIsCacheable(TSHttpTxn txnp, TSMBuffer request, TSMBuffer response);
{code}


> Add an API to query if a response header would be cacheable
> -----------------------------------------------------------
>
>                 Key: TS-1622
>                 URL: https://issues.apache.org/jira/browse/TS-1622
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: TS API
>            Reporter: Leif Hedstrom
>              Labels: A
>             Fix For: 6.0.0
>
>
> It would be useful for a plugin to be able to take e.g. a response header (a Hdr object) and ask the HttpSM if this response would be cacheable or not. It should use the same logic (and configs) as the core does normally.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)