<div dir="ltr">Thanks, so, to make things clean you are going to need to use a couple of vmods, which means being able to compile them first:<div>- <a href="https://github.com/otto-de/libvmod-uuid">https://github.com/otto-de/libvmod-uuid</a> as Geoff offered</div><div>- <a href="https://github.com/Dridi/libvmod-querystring">https://github.com/Dridi/libvmod-querystring</a> that will allow easy manipulation of the querystring</div><div><br></div><div>unfortunately, the install-vmod tool that is bundled into the Varnish docker image isn't able to cleanly compile/install them. I'll have a look this week-end if I can, or at least I'll open a ticket on <a href="https://github.com/varnish/docker-varnish">https://github.com/varnish/docker-varnish</a></div><div><br></div><div>But, if you are able to install those two, then your life is easy:</div><div>- once you receive a request, you can start by creating a unique ID, which'll be the the vcl equivalent of `uuidgen | sed -E 's/(\w+)-(\w+)-(\w+)-(\w+).*/\1\2\3\4/'` (without having testing it, probably `regsub(uuid.uuid_v4(), "s/(\w+)-(\w+)-(\w+)-(\w+).*", "\1\2\3\4/"`)</div><div>- then just add/replace the parameter in the querystring with vmod_querystring</div><div><br></div><div>and...that's about it?</div><div><br></div><div>Problem is getting the vmods to compile/install which I can help with this week-end. There's black magic that you can do using regex to manipulate querystring, but it's a terrible idea.</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div><div>Guillaume Quintard<br></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 31, 2023 at 6:48 PM Uday Kumar <<a href="mailto:uday.polu@indiamart.com">uday.polu@indiamart.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Does it need to be unique? can't we just get away with "aaaaaaaaaaaaaaaaaaaa"?</div></blockquote><div> </div>Our Requirements:<br>1. New Parameter should be <b>appended </b>to already existing parameters in Query String. (should not replace entire query string)<br>2. Parameter Value <b>Must be Unique for each request</b> (ideally unique randomness is preferred)<br>3. Allowed Characters are Alphanumeric which are <b>URL safe</b> [can be lowercase, uppercase in case of alphabets]<br>4. Characters can be repeated in parameter value EX: Gn4lT<b>Y</b>gBgpPaRi6hw6<b>Y</b>S (here, Y is repeated) But as mentioned above the value must be unique as a whole.<br><br>Ex: Parameter value for 1st request can be "Gn4lT<b>Y</b>gBgpPaRi6hw6<b>Y</b>S",<br><div> 2nd request can be "G34lTYgBgpPaRi6hyaaF" and so on </div><div><br></div><div><br></div><div>Thanks & Regards</div><div>Uday Kumar</div></div></div>
</blockquote></div>