los / response-time
PHP middleware to add a Response Time header
Fund package maintenance!
Lansoweb
Installs: 59 290
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ^8.1
- psr/container: ^1.0 || ^2.0
- psr/http-message: ^1.0 || ^2.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- laminas/laminas-coding-standard: ^2.5
- phpstan/phpstan: ^1.10
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-12-19 18:48:37 UTC
README
This middleware adds a Response Time header
Usage
Just add the middleware as one of the first in your application.
For example:
$app->pipe(new \Los\ResponseTime\ResponseTime($options);
And the middleware will add a header
X-Request-Time: 49,96ms
The options are:
- header_name: Header name. Default: X-Response-Time
Mezzio
If you are using mezzio-skeleton,
you can copy config/los-response-time.global.php.dist
to
config/autoload/los-response-time.global.php
and modify configuration as your needs.