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:
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>
When it comes to web site performance, it can be millions of things. It's not necessary the JavaScript files that causing the problem. Here's few things that might help you:
for iPads (and also any other device / platform that has a browser which is not IE 8 or less) jQuery 2 perform way better.. it is actually jQuery that weight a lot and in older versions it carries on lots of unrelevant validations and backward compatibility stuff
so, you can try to:
in short (based on this post Detect Internet explorer browser version problems)
var jQuery = "~/Scripts/jquery-2.1.1.min.js";
if ((Request.Browser.Browser == "IE") && ((Request.Browser.MajorVersion < 9)))
{
jQuery = "~/Scripts/jquery-1.8.2.min.js";
}
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
jQuery,
"~/Scripts/jquery.easing.1.3.js",
"~/Scripts/knockout-2.2.0.js",
"~/Scripts/common/common.min.js",
"~/Scripts/popup.min.js"
));
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.
Try downloading wireshark to the server, start it up, and recreate the error while capturing the packet flow. Then find the packets for that application right click and choose "Follow TCP Stream". You'll be able to see and filter just those packets out.
You want to look for inbound requests and outbound responses with respect to how long it took for the server to respond. If the times are fast <100ms then you have to next look to see how long each subsequent request from the IPAD is taking. You should be able to spot where the dealays easily just by looking at the relative time column in the trace.
From there if this is a pure client issue you'll need to focus on the device side. If it's a network thing, then you'll at least be able to rule out the application. If it's an application issue, then you'll be able to see what needs to be corrected.
Keep in mind that no application can run from a client until all the network things are ready, for example there must be a DNS resolve before any packets can fly. You may also note that one or more duplicate packets are being sent.. This is usually an indicator of improper bridging and or router issues. There may also be what is known as a Hop count issue, whereby delays are being caused by the number of routers the device has to hit. There could also be a router "Breathing" issue whereby the router's traffic is overwhelming it (which the architecture says "just throw the packets away"). When this happens TCP attempts to retry, which in essence makes things worse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With