Luke94
Luke94

Reputation: 712

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

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?

Upvotes: 2

Views: 834

Answers (2)

Manuel
Manuel

Reputation: 914

  1. Use JSON instead of XML
  2. If you are loading a Tree, you can make use of the "Lazy Loading" principle

Upvotes: 1

Grant Thomas
Grant Thomas

Reputation: 45068

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.

Upvotes: 0

Related Questions