MVC Web サイトが最初のバイトまでの時間が非常に遅くなる理由について、誰でも考えられます。ホームページにはデータベース接続がありません。mvc ホームページをアップロードしたところ、読み込みに約 15 秒かかり、URL をコピーして別のブラウザ ウィンドウに貼り付けます。
しかし、最後に index.html を配置すると、すぐに読み込まれます。
URL を削除しました
ソースコードをコピーしてメモ帳に貼り付けてhtmlページを作成すると、非常に高速です
サイトは Windows IIS 7.5 で実行されます
問題を見つけようとしている間、サイト全体を実際にアップロードできません
ありがとうジョージ
----------------------ホームページのコード---------------
using DevTrends.MvcDonutCaching;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.SessionState;
using Web.UI.ModelHelpers.Validation;
namespace Web.UI.Controllers
{
//[SessionState(SessionStateBehavior.Disabled)]
public class HomeController : Controller
{
// [DonutOutputCache(CacheProfile = "Cache1Hour")]
public ActionResult Index()
{
ViewBag.Title = "Active Tourist Search Engine";
return View();
}
public PartialViewResult pvSearchForm(string Option, string Page)
{
if (string.IsNullOrEmpty(Option) || string.IsNullOrEmpty(Page))
{
var model = new SearchEngineValidation
{
Option = "Web",
Page = "1",
ISB = "1",
};
ViewBag.SearchButtonText = "Web";
return PartialView("~/Views/Shared/pvSearchForm.cshtml", model);
}
else
{
var model = new SearchEngineValidation
{
Option = Request.QueryString["Option"],
Page = Request.QueryString["Page"],
ISB = "0",
};
ViewBag.SearchButtonText = model.Option;
return PartialView("~/Views/Shared/pvSearchForm.cshtml", model);
}
}
}
}
キャッシングをコメントアウトしたことに気付くでしょう。キャッシングオンロードは高速ですが、根本的な問題を見つけようとしています
Fiddler からの出力
Request Count: 1
Bytes Sent: 323 (headers:323; body:0)
Bytes Received: 6,325 (headers:270; body:6,055)
ACTUAL PERFORMANCE
--------------
ClientConnected: 13:30:39.611
ClientBeginRequest: 13:30:39.611
GotRequestHeaders: 13:30:39.611
ClientDoneRequest: 13:30:39.611
Determine Gateway: 0ms
DNS Lookup: 1ms
TCP/IP Connect: 38ms
HTTPS Handshake: 0ms
ServerConnected: 13:30:39.651
FiddlerBeginRequest: 13:30:39.651
ServerGotRequest: 13:30:39.652
ServerBeginResponse: 13:30:54.102
GotResponseHeaders: 13:30:54.102
ServerDoneResponse: 13:30:54.102
ClientBeginResponse: 13:30:54.154
ClientDoneResponse: 13:30:54.154
Overall Elapsed: 00:00:14.5428318