Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable gzip compression when api calls #504

Merged
merged 2 commits into from Jan 16, 2019
Merged

Conversation

rnakano
Copy link
Contributor

@rnakano rnakano commented Jan 16, 2019

Issue

  • None

Overview (Required)

I think using HTTP with gzip compression is a good way to reduce network traffic.

OkHttp adds Content-Encoding: gzip header automatically. However, to enable gzip in GoogleAppEngine, it must also be included in User-Agent.

Links

Screenshot

Before ⬇️
2019-01-16 19 09 11

After ⬇️
2019-01-16 19 11 10

I confirmed that the traffic of the timetable decreased to 1/3 by the Android Profiler.

@jmatsu-bot
Copy link
Collaborator

@panpanini
Copy link
Contributor

However, to enable gzip in GoogleAppEngine, it must also be included in User-Agent.

📝 thats really useful information!! thanks!

@panpanini
Copy link
Contributor

I wonder about iOS as well, is it possible to do something for this in ApiComponent.kt as well?
https://github.com/DroidKaigi/conference-app-2019/blob/master/data/api-impl/src/iosMain/kotlin/io/github/droidkaigi/confsched2019/data/api/ApiComponent.kt#L17

@rnakano
Copy link
Contributor Author

rnakano commented Jan 16, 2019

Of course! I will also modify iOS code.

@rnakano rnakano changed the title Enable gzip compression when api calls [WIP] Enable gzip compression when api calls Jan 16, 2019
@rnakano
Copy link
Contributor Author

rnakano commented Jan 16, 2019

I confirmed that the traffic was reduced even on iOS 😃

⬇️ Profiler Screenshot

Before After

@rnakano rnakano changed the title [WIP] Enable gzip compression when api calls Enable gzip compression when api calls Jan 16, 2019
Copy link
Contributor

@panpanini panpanini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 💯 💯 amazing!

@jmatsu-bot
Copy link
Collaborator

@jmatsu-bot
Copy link
Collaborator

Apk comparision results

Property Summary
New File Size 13801063 Bytes. (13.16 MB)
File Size Change +132 Bytes. (+0.13 KB)
Download Size Change -1459 Bytes. (-1.42 KB)
New Method Reference Count 153760
Method Reference Count Change 0
New Number of dex file(s) 4
Number of dex file(s) Change 0

Generated by 🚫 Danger

@jmatsu-bot
Copy link
Collaborator

Asserted successfully. 💯

Generated by 🚫 Danger

@panpanini panpanini merged commit a87b55f into DroidKaigi:master Jan 16, 2019
@rnakano rnakano deleted the gzip branch January 16, 2019 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants