How to request compressed response with Ionic

Hello,

We are working with ionic for a year now and we are looking to optimize our server call. Our app is using an online search engine and we discovered that call made to this search engine was not compressed with gzip. Using curl we have been able to prove that we are able to toggle the compression by add the header “Accept-Encoding: gzip”. For security reason, it seems that we can set this header at call time.

So my question is the following: how can I set headers properly so my call are using the gzip compression? Did anyone had such issue? How did you solve it?

Thank you!

Hey, I think that’s not that you can do it by ionic app. You need to use gzip on your server. Correct me if I’m wrong

Hello,

Yes gzip compression is enabled on the server, i have been to prove using curl that the compression is used or not according to the header. As per the rfc (it is up to server to use compression or not if nothing is specified), the serveur does not transfer a compressed version. I would like to make sure it is by adding the right headers in my call. Unfortuntly, for security reasons, i cant do in JS.