beyondcode/laravel-server-timing
Add Server-Timing headers to your Laravel responses so you can see exactly where time goes—middleware, database queries, and custom measurements—right in your browser's developer tools. A simple, fluent API lets you instrument any part of a request. No external services needed.
Architecture fit. beyondcode/laravel-server-timing occupies exactly one seam: the HTTP response pipeline. It ships a middleware plus a ServerTiming facade that appends W3C-standard Server-Timing headers to outgoing responses. It does not touch the ORM, queue, container internals, session, or persistence, so it composes with any Laravel application regardless of domain architecture and imposes no structural constraints on feature teams. From a TPM's seat, this is the ideal shape of a dependency to sponsor: one well-understood integration point, no blast radius beyond it, and no architectural argument to win before teams can try it. The MIT license removes procurement from the critical path entirely.
Integration feasibility. High and cheap. The work is composer require, registering ServerTimingMiddleware in the stack (the service provider and facade alias are auto-discovered, but the middleware is not auto-registered), optionally publishing config, and wrapping blocks of interest in ServerTiming::start() / stop() / addMeasure(). No migrations, no schema changes, no external service, no credentials, no infrastructure provisioning. The 1.7.0 release (2026-03-23) is a compatibility-only change — Laravel 13.x support via PR #42 — with no API or behavioural delta, which matters because it is simultaneously the version that unblocks teams planning the framework-major upgrade. The one mild negative signal is Dependents: 0: effectively no downstream ecosystem validation, so our own pilot is the proof, not someone else's production track record.
Technical risk. Low but not zero, concentrated in five areas:
Key questions.
Stack fit. Excellent for a Laravel/PHP estate and effectively zero-fit-cost elsewhere. Conventional service provider plus middleware, package discovery handles the provider and facade alias, no PHP extension requirements, no Node toolchain, no sidecar, no daemon. It works with global and route-group registration and behaves the same under the Laravel 11+ bootstrap/app.php style and the legacy app/Http/Kernel.php style — relevant if the estate spans majors.
Migration path. Additive and fully reversible. Pilot on one or two non-critical services, register the middleware for non-production only, instrument a deliberately small milestone set, and validate the DevTools waterfall (Network → request → Timing → Server Timing) against a known baseline such as TTFB. Rollback is middleware/config removal plus composer remove — no data migration, no backfill, no cleanup, no user-visible change. That reversibility is what makes this a safe ask of an already-loaded platform team.
Compatibility. Before pinning, confirm three things per service: (1) the package's composer.json floor for laravel/framework and PHP resolves against our lowest supported runtime — a service on Laravel 10 or below should be validated separately, not assumed equivalent; (2) registration style matches that service's Laravel major; (3) services with custom kernels, unusual middleware stacks, or long-running workers (Octane) still execute the middleware in the correct position. Given Dependents: 0, treat compatibility claims as untested by third parties and verify locally.
Sequencing.
Maintenance. Minimal but non-zero, and lumpy rather than continuous. The realistic budget is one dependency bump per Laravel major, evidenced by 1.7.0 being a pure compatibility release with no feature content. The surface area is two files — facade and middleware — so the maintenance risk is version alignment, not code comprehension. Assign the bump to whoever owns framework upgrades, and add it as a line item on the Laravel-major upgrade checklist.
Support. Single-maintainer community package with no commercial SLA. That is acceptable for a developer-facing diagnostic convenience and unacceptable as load-bearing production infrastructure. Treat it as a disposable diagnostic aid: if it broke tomorrow, engineers lose a convenience, not a capability the business depends on. Write that framing into the dependency record explicitly, so nobody builds a workflow or a customer-facing report on top of it. The upstream response time on the Laravel 13 bump is reassuring but is not a contractual commitment.
Scaling. Favourable. Header emission is effectively O(1) per request with negligible CPU and a few hundred bytes of payload. No shared state, no storage, no cross-request coordination, so it scales horizontally with the app and requires no capacity planning or load-test cycle. The one caveat is cumulative header bloat: liberal custom milestones inflate every response and can approach proxy/CDN header-size limits. Cap the milestone set, enforce the naming convention, and consider per-environment scoping or sampling if overhead ever becomes measurable at traffic scale.
Failure modes.
Ramp-up. Near zero for any engineer already comfortable in browser DevTools: install, register, wrap a code block, read the waterfall. The real onboarding cost is judgement, not mechanics — teaching the milestone discipline (small, named, low-cardinality), the ordering verification, and the production gate. Budget a short written onboarding note and one demo per service rather than formal training.
How can I help you explore Laravel packages today?