Skip to content

Commit a4cc8dd

Browse files
authored
Add request processing pipeline diagrams to middleware doc (#17623)
* Add request processing pipeline diagrams to middleware doc * minor edit * minor edits * React to feedback
1 parent d00d4d4 commit a4cc8dd

3 files changed

Lines changed: 772 additions & 2 deletions

File tree

aspnetcore/fundamentals/middleware/index.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn about ASP.NET Core middleware and the request pipeline.
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 02/02/2020
8+
ms.date: 04/06/2020
99
uid: fundamentals/middleware/index
1010
---
1111
# ASP.NET Core Middleware
@@ -62,9 +62,17 @@ In the preceding example, the `Run` delegate writes `"Hello from 2nd delegate."`
6262

6363
## Middleware order
6464

65+
The following diagram shows the complete request processing pipeline for ASP.NET Core MVC and Razor Pages apps. You can see how, in a typical app, existing middlewares are ordered and where custom middlewares are added. You have full control over how to reorder existing middlewares or inject new custom middlewares as necessary for your scenarios.
66+
67+
![ASP.NET Core middleware pipeline](index/_static/middleware-pipeline.svg)
68+
69+
The **Endpoint** middleware in the preceding diagram executes the filter pipeline for the corresponding app type—MVC or Razor Pages.
70+
71+
![ASP.NET Core filter pipeline](index/_static/mvc-endpoint.svg)
72+
6573
The order that middleware components are added in the `Startup.Configure` method defines the order in which the middleware components are invoked on requests and the reverse order for the response. The order is **critical** for security, performance, and functionality.
6674

67-
The following `Startup.Configure` method adds security related middleware components in the recommended order:
75+
The following `Startup.Configure` method adds security-related middleware components in the recommended order:
6876

6977
[!code-csharp[](index/snapshot/StartupAll3.cs?name=snippet)]
7078

0 commit comments

Comments
 (0)