← Back
Cloudflare
Cloudflare adds cfWorker metric to Server-Timing header for performance debugging

Overview

The Server-Timing header now includes a dedicated cfWorker metric that breaks down execution time spent in Cloudflare Workers. Previously, Worker execution time was bundled into the edge metric, making it difficult to pinpoint performance bottlenecks between edge processing and upstream dependencies.

What Changed

The metric breakdown now clearly separates:

  • edge: Total time on Cloudflare edge (including Worker execution)
  • origin: Time spent fetching from origin server
  • cfWorker: Time spent in Worker execution and subrequests (excluding origin fetch)

Example response header:

Server-Timing: cdn-cache; desc=DYNAMIC, edge; dur=20, origin; dur=100, cfWorker; dur=7

Availability and Enablement

The cfWorker metric is enabled by default if you have Real User Monitoring (RUM) enabled. Users without RUM can enable it via Rules configuration in the Cloudflare dashboard.

Benefits for Developers

  • Performance debugging: Quickly determine whether latency stems from Worker code, external API calls within Workers, or slow origins
  • Optimization targeting: Identify which component of the request path requires optimization
  • Real User Monitoring: Access detailed timing breakdowns directly from response headers for client-side analytics and monitoring

The metric is particularly valuable for developers running complex Workers with multiple subrequests or external API integrations.