Does it need to be unique? can't we just get away with
"aaaaaaaaaaaaaaaaaaaa"?

the crude VCL code would look like:
    set req.url = regsub(req.url, "\?.*","?yourparam=aaaaaaaaaaaaaaaaaaaa");

i.e. getting rid of the whole query string and just putting yours in place.

-- 
Guillaume Quintard


On Wed, May 31, 2023 at 11:07 AM Uday Kumar <uday.p...@indiamart.com> wrote:

> Hello,
>
> We would like to configure varnish to create unique parameter such that
> its value should be of 20 characters (alphanumeric characters that are URL
> safe).
>
> On Wed, May 31, 2023, 13:34 Guillaume Quintard <
> guillaume.quint...@gmail.com> wrote:
>
>> >  Could you please also suggest how to configure Varnish so that Varnish
>> can add Unique Parameter by itself??
>>
>> We'd need more context, is there any kind of check that tomcat does on
>> this parameter, does it need to have a specific length, or match a regex?
>> If we know that, we can have Varnish check the user request to make sure
>> it's valid, and potentially generate its own parameter.
>>
>> But it all depends on what Tomcat expects from that parameter.
>>
>> --
>> Guillaume Quintard
>>
>>
>> On Tue, May 30, 2023 at 11:18 PM Uday Kumar <uday.p...@indiamart.com>
>> wrote:
>>
>>> Hello Guillaume,
>>>
>>> Thank you so much for your help, will try modifying vcl_hash as
>>> suggested!
>>>
>>>
>>>> Last note: it would probably be better if the tomcat server didn't need
>>>> that unique parameter, or at the very least, if Varnish could just add
>>>> it itself rather than relying on client information as you're caching
>>>> something public using something that was user-specific, so there's
>>>> potential for snafus here.
>>>>
>>>
>>>  Could you please also suggest how to configure Varnish so that Varnish
>>> can add Unique Parameter by itself??
>>>
>>
_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to