mvc网站第一个字节的时间非常慢

时间:2013-03-01 13:09:27

标签: web-applications asp.net-mvc-4 iis-7.5

任何人都知道为什么mvc网站在第一个字节的时间内会如此慢。主页没有数据库连接,我刚刚上传了一个mvc主页,它需要大约15秒才能加载,复制网址并粘贴到另一个浏览器窗口并且需要一段时间。

但是最后放了一个index.html,它会快速加载。

已删除网址

如果我复制源代码并粘贴到记事本中并创建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

0 个答案:

没有答案