Compression of XML containing base64 data

534 views Asked by At

I have an XML file which contains long base64 string data. The size of the XML is roughly 6KB, I want to reduce the size of the XML to somewhere about 1.5 to 2KB. The text compression I am looking for should be lossless. I have tried to use a lot of libraries like GZIP, bzip2 and deflate for compression. Can some other path be taken to achieve better results

1

There are 1 answers

0
Mark Adler On

I would extract the XML contents, decode the Base-64 to binary, and create a binary format that can be losslessly converted back to the XML. Then I would try to compress that binary representation.

However if the decoded binary data is not itself very compressible, then you're not going to get to a factor of three to four compression.