You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Make sure that we gzip telemetry events before sending them. gzip could reduce the time the mobile radio is working, especially on slower connections, and thus reduce battery impact.
If content encoding is set to gzip, this is automatically handled in the background by Okhttp on Android.
You can verify this is the related unit-test, here they are showing Okhttp transparent gzipping in action. update above is for response coming from server. Here is shown to add this to the request.
Activity
friedbunny commentedon Feb 16, 2016
I'm surprised that we don't do this already.
tobrun commentedon Feb 17, 2016
If content encoding is set to gzip, this is automatically handled in the background by
Okhttpon Android.You can verify this is the related unit-test, here they are showing Okhttp transparent gzipping in action.
update above is for response coming from server. Here is shown to add this to the request.
boundsj commentedon Feb 17, 2016
There are 3rd party libs that make this transparent for iOS, too (https://github.com/AFNetworking/AFgzipRequestSerializer/blob/master/AFgzipRequestSerializer/AFgzipRequestSerializer.m?#L57) but we don't use a 3rd party dep in the iOS bindings
mawajdak commentedon Feb 18, 2016
الشبكات
لا توجد شبكات
friedbunny commentedon Jun 23, 2016
Resources that we can draw upon for our own GZIP implementation:
tobrun commentedon Jun 23, 2016
What I mentioned in #3979 (comment) is not true.
To GZIP our communication we need to implement the following request interceptor on OkHttp: https://github.com/square/okhttp/blob/3f7a3344a4c85aa3bbb879dabac5ee625ab987f3/samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java#L73
This shouldn't be a big lift since we just need to copy/paste it into our telemetry web service code.
ivovandongen commentedon Jun 24, 2016
@tobrun We're using something similar in Human too. Can take a look at that too if you want.
mick commentedon Jun 24, 2016
The api already accepts gzip'd JSON as long as the following headers are set on the POST request:
4 remaining items
[ios] #3979 cleaned up test case
[ios] #3979 cleanup
[ios] #3979 gzip -> deflate
bleege commentedon Jul 1, 2016
I've ticketed out the Android work in #5536.
[ios] #3979 wip gzip telemetry events
[ios] #3979 Exposed decompress from mbgl and added a test case
[ios] #3979 cleanup
[ios] #3979 cleaned up test case
[ios] #3979 cleanup
[ios] #3979 gzip -> deflate
[ios] #3979 compress telemetry events (#5490)
friedbunny commentedon Jul 5, 2016
This is done on the iOS side (#5490) and will be included in the final v3.3.0 release.
zugaldia commentedon Sep 26, 2016
Work for Android was done in #5536 and for iOS in #5490. I think we're good to close here.