- How do I install beyondcode/laravel-server-timing in a Laravel app?
- Run composer require beyondcode/laravel-server-timing. Package discovery registers the service provider and the ServerTiming facade alias automatically, but you still need to add ServerTimingMiddleware to your HTTP middleware stack yourself. There are no migrations, no required config file, and no credentials or external services to set up.
- Which Laravel versions does laravel-server-timing support?
- The package tracks Laravel majors, and release 1.7.0 added Laravel 13.x support as a compatibility-only change with no API or behavioural differences. Check the composer.json constraint of the version you install to confirm the exact framework range. If you are planning a framework-major upgrade, bump this package in the same pull request.
- How do I add custom timing measurements to a request?
- Use the ServerTiming facade: call ServerTiming::start('name') before a block of work and stop('name') after it. You can also record a duration directly with addMeasure(). Every measurement becomes an entry in the Server-Timing response header, so keep names short, stable, and low-cardinality.
- Is it safe to emit Server-Timing headers in production?
- Timing data is visible to anyone who can read the response, so query counts, route and controller identifiers, and custom milestone labels can leak internal structure. Gate emission behind an environment check, config flag, or authorization check instead of relying on per-service discipline. Many teams enable it only in local and staging environments.
- Why is the Server-Timing header missing from my response?
- The most common cause is that ServerTimingMiddleware was never added to your HTTP kernel's middleware stack, because it is not auto-registered. A missing or misordered middleware produces no header and no error, which reads like there is no timing problem rather than that instrumentation is missing. Verify with curl -I against a route that actually passes through the middleware.
- Does it work with Laravel Octane and custom middleware stacks?
- It is a plain middleware, so it works under Octane and custom kernels as long as it sits in the stack that actually handles the request. Placement matters: it must run early enough to wrap the work you want to measure. If a service builds its own kernel or middleware groups, register it there explicitly and check the ordering.
- How is this different from Laravel Telescope, Debugbar, or OpenTelemetry?
- Telescope and Debugbar are full debugging tools with storage and a UI, while this package only writes a W3C-standard Server-Timing header that your browser's DevTools network panel renders. It sends nothing to an external service and keeps no history, so there is no baseline to compare against. Teams already running OpenTelemetry or an APM should decide whether Server-Timing is a short-term convention or duplicate instrumentation.
- Does laravel-server-timing measure database queries automatically?
- No. The package does not hook into the ORM or query builder, so you wrap the code you care about with ServerTiming::start(), stop(), or addMeasure() yourself. That keeps the integration surface limited to the response pipeline, but instrumentation is only as complete as what you explicitly add.
- Do native mobile clients and third-party API consumers see the headers?
- The header is sent on every HTTP response, but only browser DevTools surface it visually and many API clients ignore it entirely. CLI commands, scheduled jobs, and queue workers never produce an HTTP response, so they are invisible to this package. Do not mistake it for coverage of all traffic.
- Who maintains beyondcode/laravel-server-timing and what license is it under?
- It is an open-source Beyond Code package released under the MIT license, which keeps procurement and legal review off the critical path. Version 1.7.0 is a compatibility-only release adding Laravel 13.x support. Downstream dependents are effectively zero, so plan to validate it with your own pilot rather than relying on someone else's production track record.