I wanted to enquire whether the req.xid
that’s mentioned in https://developer.fastly.com/reference/vcl/variables/client-request/req-xid/ is that unique to each request
Hi there - that value is generated by each cache server, so in fact it’s not just unique to the request but to the machine. If you have shielding or clustering enabled, the value will change as the request moves from one fastly server to another.
If you want an ID for a request that sticks with it as it is forwarded, I’d recommend setting a request header using a UUID, eg:
if (!req.http.Request-ID) {
set req.http.Request-ID = uuid.version4();
}