MVC 4的网站在iPad上非常缓慢 [英] MVC 4 website very slow on iPad

查看:140
本文介绍了MVC 4的网站在iPad上非常缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了销售系统的使用MVC 4,反应速度和加载时间在Windows上的一个点和Mac是即时的,但在iPad上花费8-13秒加载页面或执行一个动作,如添加项目到购物篮。为了提高Web应用程序我启用COM pression在IIS中的速度和缩小的我所有的Java脚本文件,我还用捆绑捆绑以下​​.js文件一起据称提高了页面加载,以及:


  1. jQuery的-1.8.2.min.js

  2. 淘汰赛2.2.0.js

  3. jquery.easing.1.3.js

  4. b.popup.min.js(用于显示模式弹出只有6KB)

我在页面上使用的其他JavaScript文件之间5KB和15KB.After做这一切的应用程序似乎是一个几秒钟的更快,但仍然需要非常长(8-10秒)。

有没有人经历了一个iPad类似的性能问题,并且你是如何解决的呢?还有什么我可以做,以提高性能?​​

我使用的是Windows Server 2003和IIS 6.0

这里是我的包注册code:

 公共静态无效RegisterBundles(BundleCollection包)
{
    bundles.Add(新ScriptBundle(〜/包/ jQuery的)。包括(
        〜/脚本/ jQuery的-1.8.2.min.js
        〜/脚本/ jquery.easing.1.3.js
        〜/脚本/淘汰赛2.2.0.js
        〜/脚本/普通/ common.min.js
        〜/脚本/ popup.min.js
        ));    bundles.Add(新StyleBundle(〜/内容/ CSS),包括(〜/内容/的site.css));
    BundleTable.EnableOptimizations = TRUE;
}

而这正是我把它称为母版页上:

  @using System.Configuration
<!DOCTYPE HTML>
< HTML和GT;
< HEAD>
    <间的charset =UTF-8/>
    < META NAME =视口CONTENT =WIDTH =设备宽度/>
    < META NAME =苹果移动网络应用能力的内容=YES>
    <标题> prestige SSC< /标题>
    @ Scripts.Render(〜/包/ jQuery的)
    @RenderSection(脚本,必需:false)
    @ Styles.Render(〜/内容/ CSS)
    <脚本类型=文/ JavaScript的>
        VAR screenRefreshTime ='@ ConfigurationManager.AppSettings [ScreenRefreshTime]的ToString()。';
        screenRefreshTime = parseInt函数(screenRefreshTime);
    < / SCRIPT>
< /头>
<身体GT;
    @RenderBody()
< /身体GT;
< / HTML>


解决方案

使用Wireshark的 HTTPS检查您的服务器的网络活动:// WWW .wireshark.org

我已经在服务器试图连接到使用NetBIOS和ICMP来解决客户的详细信息在客户端的问题,那就是超时。

禁用NetBIOS的在服务器上的TCP和再检查,看它是否是一个网络问题,而不是一个真正的编程问题。


  1. 转到控制面板,选择网络连接。

  2. 要静态配置右键单击本地连接,然后单击属性。

  3. 单击Internet协议(TCP / IP),点击属性,点击高级,然后单击WINS选项卡。

  4. 单击禁用NetBIOS,通过TCP / IP。

I have developed a point of sale system using MVC 4.The responsiveness and loading times on Windows and Mac is instant but on an iPad it takes 8-13 seconds to load a page or perform an action such as adding items to basket. To improve the speed of the web application I enabled compression in IIS and minified all my java script files I also used bundling to bundle the following .js files together which supposedly improves loading of pages as well:

  1. jquery-1.8.2.min.js
  2. knockout-2.2.0.js
  3. jquery.easing.1.3.js
  4. b.popup.min.js(used for displaying a modal popup only 6KB)

The other javascript files I use on pages are between 5KB and 15KB.After doing all this the application seems to be a few seconds quicker, but still takes unacceptably long(8-10 seconds).

Has anyone experienced similar performance issues on an iPad and how did you resolve it?Is there anything else I can do to improve performance?

I'm using Windows Server 2003 and IIS 6.0

Here's my bundle registration code:

public static void RegisterBundles(BundleCollection bundles)
{
    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
        "~/Scripts/jquery-1.8.2.min.js",
        "~/Scripts/jquery.easing.1.3.js",
        "~/Scripts/knockout-2.2.0.js",
        "~/Scripts/common/common.min.js",
        "~/Scripts/popup.min.js"
        ));

    bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
    BundleTable.EnableOptimizations = true;
}

And this is where I call it on the master page:

@using System.Configuration
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <title>Prestige SSC</title>
    @Scripts.Render("~/bundles/jquery")
    @RenderSection("scripts", required: false)
    @Styles.Render("~/Content/css")   
    <script type="text/javascript">
        var screenRefreshTime = '@ConfigurationManager.AppSettings["ScreenRefreshTime"].ToString()';
        screenRefreshTime = parseInt(screenRefreshTime);
    </script>
</head>
<body>
    @RenderBody()
</body>
</html>

解决方案

Check your server network activity using Wireshark https://www.wireshark.org

I've had the problem where the server was trying to connect to the client using netbios and ICMP to resolve the clients details and that was timing out.

Disable the Netbios over TCP on the server and check then to see if it's a networking issue and not actually a programming issue.

  1. Go to control panel and select Network Connections.
  2. Right-click the local area connection that you want to be statically configured, and then click Properties.
  3. Click Internet Protocol (TCP/IP), click Properties, click Advanced, and then click the WINS tab.
  4. Click Disable NetBIOS over TCP/IP.

这篇关于MVC 4的网站在iPad上非常缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆