Use /g (global) regex modifier in map

Gabriel Arrais lists at ruby-forum.com
Fri Aug 8 19:59:47 UTC 2014


Maxim Dounin wrote in post #1154708:
> Hello!
>
> On Fri, Aug 08, 2014 at 08:27:54PM +0200, Gabriel Arrais wrote:
>
>> >>         ?fq=xxxxxx&sm=0&PageNumber=1&fq=yyyyyyyyyy
>>
>>     return $filtered_args;
>>   }
>> ';
>> proxy_cache_key  $host:$uri?$filtered_args;
>>
>> Will do the job?
>
> Doing this with embedded perl snippet will be more or less
> trivial, yes.  Note though that in case of multiple arguments with
> the same name it may be important to preserve their order.

In our case the order is not important, so the cache performance talks 
louder =)

> I also suspect that split() + grep may be better/easier than a
> single regular expression to match all needed arguments.
Yes, certainly it would be easier.

Again, thank you so much for the quick responses and the attention.

-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list