Discussion:
Write Lock
Jeremy Payne
2018-01-24 21:18:51 UTC
Permalink
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
2018-01-25 14:55:40 UTC
Permalink
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);
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
Chou, Peter
2018-01-25 17:41:49 UTC
Permalink
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:***@oath.com]
Sent: Thursday, January 25, 2018 6:56 AM
To: ***@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 <***@gmail.com<mailto:***@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
Loading...