【发布时间】:2018-09-07 07:09:54
【问题描述】:
我有一个简单的 asp.net core 2.0 WebApi 应用程序在 IIS 反向代理后面的 Kestrel 中运行。单路由很简单,就是发出一个http请求:
using (HttpClient client = new HttpClient())
{
client.BaseAddress = new Uri("http://www.google.ca");
HttpResponseMessage response = await client.GetAsync("/search?q=test&oq=test");
return Ok();
}
但是,此请求始终需要 2-3 秒才能完成。然而,如果我在没有 IIS 的情况下直接运行 Kestrel,相同的代码需要大约 100 毫秒。
我遵循所有 Microsoft docs 使用 IIS 配置红隼。
【问题讨论】:
标签: iis reverse-proxy asp.net-core-2.0 dotnet-httpclient kestrel-http-server