Need Assistance in Configuring Varnish to Retain and Ignore Unique Parameter in Request URL while caching

Guillaume Quintard guillaume.quintard at gmail.com
Wed May 31 18:38:57 UTC 2023


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.polu at 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.quintard at 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.polu at 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??
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20230531/6b01f965/attachment-0001.html>


More information about the varnish-misc mailing list