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

Geoff Simmons geoff at uplex.de
Wed May 31 19:15:58 UTC 2023


On 5/31/23 20:06, Uday Kumar wrote:
> 
> 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).

I have used VMOD uuid to set unique values in each request:

https://github.com/otto-de/libvmod-uuid

The standard UUID string is 36 characters long. If you really have to 
have exactly 20 characters, you could take the last 3 blocks of hex 
characters, removing the hyphens. It would take a bit of regex slinging.

For example from: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
extract:          11d180b400c04fd430c8

Then you'd have 80 bits represented in 20 hex characters, instead of the 
128 bits represented by the standard string. The 80 bits are all 
obtained from the random number generator (the urandom device on Linux), 
so I suppose that would be enough to ensure uniqueness.


Best,
Geoff
-- 
** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753

http://uplex.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20230531/ae63cc9a/attachment.bin>


More information about the varnish-misc mailing list