jQuery: Fastest way to load and use a big XML file

828 Views Asked by At

I have a quite big XML file (around 5MB) and need to load that with jQuery. Afterwards, I would like to query and display some data in my html file (I am thinking about a similar way to do that as .NET/C# provides it).

What is the fastest way to load such a big file?

Would it be a good approach to convert the xml file to a json object (with this plugin?

2

There are 2 best solutions below

1
Manuel On BEST ANSWER
  1. Use JSON instead of XML
  2. If you are loading a Tree, you can make use of the "Lazy Loading" principle
0
Grant Thomas On

The fastest way would be to not load the entire file before you start processing; open the file on demand so that, for all practical purposes, it's ready for use by the user, then load it in parts, either buffered so it will all load in time anyway, or as required so that it will all load with use anyway.