trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chillin Gong <gongchun...@gmail.com>
Subject Re: How can I set partial value of a query parameter into cache key?
Date Tue, 26 Jun 2018 01:58:53 GMT
Brian, thanks for the guide! That's an option if there is no existing
plugin to support it.

Evan, I tried the options, but it includes the whole value string of the
parameter into the cache key. My case needs partial value into the key.


On Mon, Jun 25, 2018 at 6:00 PM, Zelkowitz, Evan <Evan_Zelkowitz@comcast.com
> wrote:

> ​Sorry, --remove-path=true
> ------------------------------
> *From:* Zelkowitz, Evan <Evan_Zelkowitz@comcast.com>
> *Sent:* Monday, June 25, 2018 6:57 PM
>
> *To:* users@trafficserver.apache.org
> *Subject:* [EXTERNAL] Re: How can I set partial value of a query
> parameter into cache key?
>
>
> ​Have you tried using the --include-params to set the params you want
> included in the key? Then you may have to add a --static-prefix=   (empty
> space to wipe out the prefix) and --remote-path=true to also remove the
> path, hopefully just leaving you with the params you want as the key.  You
> can enable the xdebug plugin and do curls with -H 'X-Debug: X-Cache-Key',
> to test and see how they turn out
> ------------------------------
> *From:* Brian Geffon <briangeffon@gmail.com>
> *Sent:* Monday, June 25, 2018 5:35 PM
> *To:* users@trafficserver.apache.org
> *Subject:* [EXTERNAL] Re: How can I set partial value of a query
> parameter into cache key?
>
> If you don't mind coding you can write a C plugin that uses:
> TSCacheUrlSet: https://docs.trafficserver.apache.org/en/latest/
> developer-guide/cache-architecture/api-functions.en.html. Or you can also
> write a C++ plugin that uses Transaction.setCacheUrl():
> https://github.com/apache/trafficserver/blob/master/lib/
> cppapi/include/atscppapi/Transaction.h#L272
>
> On Mon, Jun 25, 2018 at 4:24 PM Chillin Gong <gongchunlin@gmail.com>
> wrote:
>
>> I see. Thanks Jeremy! Will have a try to evaluate it later.
>>
>> Besides this option, does anyone has any other options?
>>
>>
>> Regards,
>> Chunlin Gong
>>
>> On Mon, Jun 25, 2018 at 4:13 PM, Jeremy Payne <jp557198@gmail.com> wrote:
>>
>>> i dont know if there is a cache url lua script already written.. but
>>> if not, just follow examples in the below to write your own.
>>>
>>> https://docs.trafficserver.apache.org/en/7.1.x/admin-
>>> guide/plugins/ts_lua.en.html
>>>
>>> On Mon, Jun 25, 2018 at 6:02 PM, Chillin Gong <gongchunlin@gmail.com>
>>> wrote:
>>> > Hi Jeremy,
>>> >
>>> > Thanks for the reply! Do you mean there are some lua scripts that
>>> implement
>>> > the cache key feature, and they can be hooked into traffic server with
>>> lua
>>> > plugin? Do you have a sample lua script for it?
>>> >
>>> >
>>> > Regards,
>>> > Chunlin
>>> >
>>> > On Mon, Jun 25, 2018 at 3:56 PM, Jeremy Payne <jp557198@gmail.com>
>>> wrote:
>>> >>
>>> >> If you're open, you'll find what you're looking for in the lua plugin.
>>> >>
>>> >>
>>> >>
>>> >> On Mon, Jun 25, 2018 at 12:02 PM, Chillin Gong <gongchunlin@gmail.com
>>> >
>>> >> wrote:
>>> >> > Hi,
>>> >> >
>>> >> > I am a new user of traffic server. Recently I am trying to migrate
a
>>> >> > product
>>> >> > from ATS5 to latest ATS7. In ATS5, we use the cache feature, and
>>> use the
>>> >> > cacheurl plugin and regular expressions to extract partial value
of
>>> a
>>> >> > query
>>> >> > parameter to comprise the cache key. However, I didn't find
>>> >> > corresponding
>>> >> > feature in ATS7 cachekey plugin to get partial value of a query
>>> >> > parameter.
>>> >> >
>>> >> > For example, our request url is something like
>>> >> > "/my/path?kw=test&geo=<country>,<state>,<city>,<street>".
In ATS5,
>>> we
>>> >> > can
>>> >> > get "geo=<country>,<state>,<city>" (without <street>)
as our cache
>>> key.
>>> >> > However, I didn't find similar syntax to get such partial value
with
>>> >> > cachekey plugin in ATS7.
>>> >> >
>>> >> > https://docs.trafficserver.apache.org/en/7.0.x/admin-
>>> guide/plugins/cachekey.en.html
>>> >> >
>>> >> > Does anyone know how I can achieve similar feature with cachekey
>>> plugin
>>> >> > or
>>> >> > other plugins?
>>> >> >
>>> >> >
>>> >> > Thanks,
>>> >> > Chunlin Gong
>>> >> >
>>> >> >
>>> >
>>> >
>>>
>>
>>

Mime
View raw message