You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Jeremy Payne <jp...@gmail.com> on 2018/01/24 21:18:51 UTC

Write Lock

Is there an over-rideable configuration or maybe an API function I can
use to disable write locks for
a given cache-key/txn ?

Basically after the cache lookup is complete, I want to parse request
headers and if header values match a certain string/condition, I want
to disable the
write lock.  I'm OK if this disables caching for the transaction.


Jeremy

RE: Write Lock

Posted by "Chou, Peter" <pb...@labs.att.com>.
Aaron,

Thanks for the response. Jeremy and I were looking for a way to cache an object that would have been blocked by the cache_promote plugin (which uses the API function you show below). We are considering adding an over-ride into this plugin, e.g., special ATS internal header, that could be set by other plugins to  allow an object to be cached earlier than the normal cache_promote policy. This would probably be better than messing around with the write-lock. Appreciate any thoughts.

Thanks,
Peter


From: Aaron Canary [mailto:acanary@oath.com]
Sent: Thursday, January 25, 2018 6:56 AM
To: users@trafficserver.apache.org
Subject: Re: Write Lock

This is how I disable writing to cache from a plugin. I'm not sure that is exactly what you are asking for.
I've used it as late as TS_HTTP_READ_RESPONSE_HDR_HOOK. But it will also work in a TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK.

    // do NOT write to cache
    TSHttpTxnServerRespNoStoreSet(txnp, 1);

On Wed, Jan 24, 2018 at 3:18 PM, Jeremy Payne <jp...@gmail.com>> wrote:
Is there an over-rideable configuration or maybe an API function I can
use to disable write locks for
a given cache-key/txn ?

Basically after the cache lookup is complete, I want to parse request
headers and if header values match a certain string/condition, I want
to disable the
write lock.  I'm OK if this disables caching for the transaction.


Jeremy



--
Aaron Canary
ATS - Senior Software Engineer

RE: Write Lock

Posted by "Chou, Peter" <pb...@labs.att.com>.
Aaron,

Thanks for the response. Jeremy and I were looking for a way to cache an object that would have been blocked by the cache_promote plugin (which uses the API function you show below). We are considering adding an over-ride into this plugin, e.g., special ATS internal header, that could be set by other plugins to  allow an object to be cached earlier than the normal cache_promote policy. This would probably be better than messing around with the write-lock. Appreciate any thoughts.

Thanks,
Peter


From: Aaron Canary [mailto:acanary@oath.com]
Sent: Thursday, January 25, 2018 6:56 AM
To: users@trafficserver.apache.org
Subject: Re: Write Lock

This is how I disable writing to cache from a plugin. I'm not sure that is exactly what you are asking for.
I've used it as late as TS_HTTP_READ_RESPONSE_HDR_HOOK. But it will also work in a TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK.

    // do NOT write to cache
    TSHttpTxnServerRespNoStoreSet(txnp, 1);

On Wed, Jan 24, 2018 at 3:18 PM, Jeremy Payne <jp...@gmail.com>> wrote:
Is there an over-rideable configuration or maybe an API function I can
use to disable write locks for
a given cache-key/txn ?

Basically after the cache lookup is complete, I want to parse request
headers and if header values match a certain string/condition, I want
to disable the
write lock.  I'm OK if this disables caching for the transaction.


Jeremy



--
Aaron Canary
ATS - Senior Software Engineer

Re: Write Lock

Posted by Aaron Canary <ac...@oath.com>.
This is how I disable writing to cache from a plugin. I'm not sure that is
exactly what you are asking for.
I've used it as late as TS_HTTP_READ_RESPONSE_HDR_HOOK. But it will also
work in a TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK.

    // do NOT write to cache
>     TSHttpTxnServerRespNoStoreSet(txnp, 1);


On Wed, Jan 24, 2018 at 3:18 PM, Jeremy Payne <jp...@gmail.com> wrote:

> Is there an over-rideable configuration or maybe an API function I can
> use to disable write locks for
> a given cache-key/txn ?
>
> Basically after the cache lookup is complete, I want to parse request
> headers and if header values match a certain string/condition, I want
> to disable the
> write lock.  I'm OK if this disables caching for the transaction.
>
>
> Jeremy
>



-- 
Aaron Canary
ATS - Senior Software Engineer