Skip to content

Commit

Permalink
Merge pull request #44186 from mihaic195/server-timing-docs-and-rails…
Browse files Browse the repository at this point in the history
…-on-rack-doc-update

doc: ActionDispatch::ServerTiming & rails_on_rack guide update [ci-skip]
  • Loading branch information
jonathanhefner committed Jan 18, 2022
2 parents 93984c7 + 3cc91bc commit 32a82eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions guides/source/api_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ An API application comes with the following middleware by default:
- `Rack::Sendfile`
- `ActionDispatch::Static`
- `ActionDispatch::Executor`
- `ActionDispatch::ServerTiming`
- `ActiveSupport::Cache::Strategy::LocalCache::Middleware`
- `Rack::Runtime`
- `ActionDispatch::RequestId`
Expand Down
10 changes: 10 additions & 0 deletions guides/source/rails_on_rack.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ $ bin/rails middleware
For a freshly generated Rails application, this might produce something like:

```ruby
use ActionDispatch::HostAuthorization
use Rack::Sendfile
use ActionDispatch::Static
use ActionDispatch::Executor
use ActionDispatch::ServerTiming
use ActiveSupport::Cache::Strategy::LocalCache::Middleware
use Rack::Runtime
use Rack::MethodOverride
Expand Down Expand Up @@ -217,6 +219,10 @@ config.middleware.delete! ActionDispatch::Executor

Much of Action Controller's functionality is implemented as Middlewares. The following list explains the purpose of each of them:

**`ActionDispatch::HostAuthorization`**

* Guards from DNS rebinding attacks by explicitly permitting the hosts a request can be sent to. See the [configuration guide](configuring.html#actiondispatch-hostauthorization) for configuration instructions.

**`Rack::Sendfile`**

* Sets server specific X-Sendfile header. Configure this via `config.action_dispatch.x_sendfile_header` option.
Expand All @@ -233,6 +239,10 @@ Much of Action Controller's functionality is implemented as Middlewares. The fol

* Used for thread safe code reloading during development.

**`ActionDispatch::ServerTiming`**

* Sets a [`Server-Timing`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing) header containing performance metrics for the request.

**`ActiveSupport::Cache::Strategy::LocalCache::Middleware`**

* Used for memory caching. This cache is not thread safe.
Expand Down

0 comments on commit 32a82eb

Please sign in to comment.