Internet search not responding while loading a large page

We have an html page displayed in a browser (IE) that causes the browser to freeze. The page is created using the server side of the script (ASP.NET and viewstate are disabled). The page takes a long time to load (this is not a problem, since we can play it on the local machine) and sometimes leads to a script error. When debugging the problem, we found that the client-side html size is 4.73 MB. There is also a lot of DOM workaround (using jQuery) after the document is ready (jquery-document.ready). After loading, the page also freezes during any interaction with the user (scrolling, mouse hover), etc. When loading and during any interaction with the user there is a surge in processor usage (25-50% of use)

+4
source share
4 answers

If the "Script Unresponsive" dialog box is a problem at startup, you can trick it, at least in older versions of IE. Divide the work you do into several tasks with setTimeout . This causes IE to lose information about how much total runtime is being used.

You can throw out some kind of “boot” div when the background work progresses, this at least leads to a better user experience.

+1
source

The first thing I look at is the insanely large size of the HTML that the client receives. Internet Explorer is not known for quickly processing large amounts of HTML, especially if you do not do many DOM crawls. The DOM processing of such a large tree explains the processor spike.

Is it really necessary to send so much HTML to the client?

0
source

This may or may not help you, but the only time I saw html pages even remotely approaching this size was when someone wrote massive amounts of data to js arrays for search.

Perhaps consider moving some data (or even html if it can be partitioned) into / ajax web service calls? In any case, searches are often much more effective.

If it's just raw html, think about splitting it up and load the next section via ajax when the user scrolls / clicks the / etc tab.

0
source

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


All Articles