i'm sending the 5mb base64 string to the backend api from the unity android app. while post and get the app gets slow because of heavy data is incoming. i want to compress the base64 5mb string to lesser size. can anyone help me in finding the solution
i have tried all the solutions like GZipStream and all other, but they are working fine with the normal string but not helping when trying with base64.
can anybody tell how to compress and decompress base64 string.
Base64 is already encoded in a way which does not suit most compression algorithms - see Why does base64-encoded data compress so poorly? for details.
You will want to compress the original binary data and then base64 the compressed data, or don't bother converting to base64 at all.
Additionally many HTTP clients/servers will automatically compress the stream, so this may be happening already implicitly.
A better question may be why you are sending such a large amount of data in a web request, perhaps you should try to reduce the size instead of attempting to compress it...
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