Jsdelivr: Add a response header to show current CDN

Created on 22 Aug 2019  路  3Comments  路  Source: jsdelivr/jsdelivr

QUANTIL has its specific response header: x-via.
Cloudflare has its specific response header: cf-ray, server: cloudflare
Stackpath has its specific response header: server: NetDNA-cache/2.2
Fastly has its specific response header: x-served-by, but since jsDelivr uses Fastly as middle load balancer and cache layer, for cdn.jsdelivr.net it is not unique.

I suggest adding a response header like 'x-jsdelivr-cdn: fastly' 'x-jsdelivr-cdn: stackpath' 'x-jsdelivr-cdn: cloudflare', and if no 'x-jsdelivr-cdn' header is given, then the request could have hit QUANTIL. I believe it could be helpful when debugging.

discussion

Most helpful comment

This would have to be done by each provider separately and I'm not sure if all of them support setting custom headers. The correct detection logic is this though:

  • server: cloudflare - Cloudflare
  • server: NetDNA-cache/2.2 - StackPath
  • x-via - Quantil
  • none of the above - Fastly

All 3 comments

This would have to be done by each provider separately and I'm not sure if all of them support setting custom headers. The correct detection logic is this though:

  • server: cloudflare - Cloudflare
  • server: NetDNA-cache/2.2 - StackPath
  • x-via - Quantil
  • none of the above - Fastly

@MartinKolarik

Stackpath and Fastly support custom header:

Cloudflare doesn't mentioned custom headers in their docs but I wonder if you can ask Cloudflare Engineer to help setup a custom response header.

QUANTIL doesn't support custom response headers.

Closing this as it wouldn't work with quantil and the detection is still possible as per my previous comment.

Was this page helpful?
0 / 5 - 0 ratings