My question is if there is an easy way to compress an XML file. I read about EXI, gzip and similar, but I didn’t understand how to do it, or if my question is possible.
What I am trying to achieve is to reduce the size of my XML file that I use with SimpleXML. Is that possible and if it is, will this have an impact on speed/performance/memory ?
Also, a large XML file is considered large based on the size or the number of elements?
Are there any tips that you should follow for a “better” XML?
The best way I can think is just to remove as much unnecessary data as possible. i.e. don’t make it formatted for human readability. That would include many unnecessary spaces/tabs/newlines. Use self closing tags whenever possible and just reduce the content down to the bare minimum that still meets XML specs. I’m sure there are compressors out there that do this. This kind of “compression” does not require decompression before parsing, but in turn may not save you much space.