假设我们的中间件是这样的(可以自由排列, 扩展自定义中间件)
logging负责记录请求/响应
staticFiles 负责响应 静态文件
MVC 负责响应 视图
当.net core web app收到一个请求图片文件的http ,过程是这样的
1. logging中间件 记录请求
2.StaticFiles中间件 判断是不是请求图片,如果是处理
3.MVC中间件 判断是不是请求视图,如果是处理
4.产生响应
5.MVC中间件 响应回调
6.StaticFiles中间件 响应加高
7.logging中间件 响应回调