trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Geffon <briangef...@gmail.com>
Subject Re: How can I set partial value of a query parameter into cache key?
Date Mon, 25 Jun 2018 23:35:10 GMT
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