I have a php script that reads an XML file and modifies it with SimpleXML. After all the modifications are done script saves the file (size ~ 2.8 mb).
I need to load this XML file with jQuery and it takes quite some time. Is there a way to compress/minify my XML file to reduce loading time in my AJAX call.
UPDATE:
The XML file contains SVG for the webpage (large metabolic map) therefore it has to preserve all the contents of XML-nodes.
EDIT The OP made clear that this is about an SVG file after I wrote my answer.
Don't transport 2.5MB of XML to the client if you do not absolutely need all of it on the client (and I doubt you do). A better strategy is to use the XML file like a database:
It's a little more work that way. but it will boost speed — probably by several orders of magnitude.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With