I have a 'menu' HTML page. The Menu contains Book names and its chapters. It is designed like a tree like structure, built using tags UL & LI. The file is 2.6mb. The file is loading very slow on to the website. Are there any suggestions to improve its load time. Thank you.
Talk1:
he is talking about a 2.6MB html file that has nothing but an unordered list.
Talk2:
That is insane. There are lots of ways to load that data on demand as user interacts with it.
Talk3:
Consider Clusterize.js, it should process any huge list without any problems, even if it's 2.6mb
Solutions1
One suggestion would be to only load the data that is visible to user and defer the loading of the rest to later time using ajax if that is possible.
Basically you load the top level items, then on click of any menu item you can make an ajax call to load it's children dynamically.
Talk1:
Lazy loading using javascript is definitely the way to go
Talk2:
Thanks for the suggestion. I will try it.
Solutions2
This is a very broad question to ask, without seeing the HTML or a representation there's no good way to answer this.
However, I can give some pointers:
check that compression is enabled for the website, or at least this
page.
simplify the structure check that the page has a good cache
header, so the client doesn't need to download it regularly
consider
using a dynamic page (json/jquery) that only loads the content of the
segment when it's clicked on. (as TeaCode suggests)
You mention C# and HTML5 in your tags, is this file auto-generated by a site?