Write Lock

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Write Lock

Jeremy Payne
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
Reply | Threaded
Open this post in threaded view
|

Re: Write Lock

Aaron Canary
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

RE: Write Lock

Chou, Peter

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:[hidden email]]
Sent: Thursday, January 25, 2018 6:56 AM
To: [hidden email]
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 <[hidden email]> 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