MVC 4 website is very slow on iPad

I developed a point-of-sale system using MVC 4. The response time and loading time on Windows and Mac are instant, but on the iPad it takes 8-13 seconds to load a page or perform actions such as adding items to the cart. To increase the speed of the web application, I turned on compression in IIS and minimized all my java script files, which I also used to combine the following .js files, which supposedly improve page loading:

  • Jquery-1.8.2.min.js
  • Knockout 2.2.0.js
  • jquery.easing.1.3.js
  • b.popup.min.js (used to display a modal pop-up window of only 6 KB)

The other javascript files that I use on the pages are between 5KB and 15KB. After that, all the time the application seems several seconds faster, but still takes an unacceptably long time (8-10 seconds).

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

I am using Windows Server 2003 and IIS 6.0

Here is my 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 here I find it on the main 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> 
+5
source share
4 answers

Check your server’s network activity with Wireshark https://www.wireshark.org

I had a problem when the server tried to connect to the client using netbios and ICMP in order to resolve client details, and this was a timeout.

Disable Netbios via TCP on the server and check if there are network problems, not a programming problem.

  • Go to the control panel and select Network Connections.
  • Right-click the LAN connection that you want to statically configure, and click Properties.
  • Click Internet Protocol (TCP / IP), click Properties, click Advanced, and then click the WINS tab.
  • Click Disable NetBIOS over TCP / IP.
+1
source

When it comes to website performance, it can be millions of things. Not necessarily JavaScript files that cause the problem. Here are a few things that can help you:

+2
source

for iPads (as well as any other device / platform that has a browser that is not IE 8 or less). jQuery 2 works better. This is actually jQuery, which weighs a lot, and in older versions it carries a lot of irrelevant checks and backward compatibility.

so you can try:

  • replace this jQuery version
  • separate the jQuery include command from the rest and use the if statement to determine if you need an older or newer version of jQuery

briefly (based on this message Internet Explorer browser browser problem detection )

 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" )); 
+2
source

Try downloading the proxy server to the server, start it and re-create the error when capturing the packet stream. Then find the packages for this application with the right mouse button and select "Follow TCP Stream". You can only see and filter these packages.

You want to search for incoming requests and outgoing responses as to how long it took for the server to respond. If times are fast <100ms, then you will need to see how long each subsequent request from the iPad takes. You should be able to determine where transactions are easily accessible by simply looking at the relative time column on the track.

From there, if this is a problem with a clean client, you need to focus on the device side. If this is a network thing, then at least you can exclude the application. If this is a problem with the application, you can see what needs to be fixed.

Keep in mind that the application cannot be launched from the client until all network functions are ready, for example, there must be DNS resolution before any packets can fly. You can also note that one or more duplicate packets are being sent. This is usually an indicator of the wrong bridges and / or routers. There may also be a so-called problem with Hop counting, as a result of which delays occur due to the number of routers that the device must reach. There may also be a problem with the Breath router, in which the router traffic suppresses it (which, according to the architecture, simply “drops packets”). When this happens, TCP tries to retry, which essentially worsens the situation.

+1
source

Source: https://habr.com/ru/post/1206890/


All Articles