Response time at CloudFlare

Hi,

Is it possible to record the response time at Cloudflare? We are using Cloudflare CDN. but WAF is provided by another vendor. We are observing a higher response time. When the testing was done directly with origin the response time was much better. While we understand there could be some latency at WAF, the response time is 4 to 5 times compared to the result when the test was done with the origin URL.

If there is an option to record the response time at Cloudflare, it will help us triaging the issue and we can focus on WAF and network latency in between. What are the options?

Thanks
Jai Prakash

Try this simple script to run in Workers:

addEventListener("fetch", (event) => {
  event.respondWith(
    handleRequest(event).catch(
      (err) => new Response(err.stack, { status: 500 })
    )
  );
});

async function handleRequest(event) {
  console.time("response time")
  var resp = await fetch("https://www.google.com") //modify the URL here
  console.timeEnd("response time")

  return new Response(true)
}

2 Likes

Thanks @erictung, let me try this, and get back.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.