Add Server Timing middleware by sebastians · Pull Request #36289 · rails/rails ·...
source link: https://github.com/rails/rails/pull/36289
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Summary
What is server timing?
It's a specification that defines how the server can communicate the
user agent performance metrics about the request it is responding to.
Here's the official specification: https://www.w3.org/TR/server-timing/
How does it work?
This introduces a new ServerTiming
middleware only on development
by
default, this is done using the config.server_timing
setting.
It works by subscribing to all ActiveSupport::Notifications
and adding
their duration to the Server-Timing
header.
Why is this useful?
It makes looking at performance metrics in development much easier,
especially when using Chrome dev tools which include the metrics in the
Network Inspector. Here's an example:
Paired on this with @guilleiguaran
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK