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

Conversation

Projects
None yet
4 participants
@rnakano
Copy link
Contributor

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

This comment has been minimized.

Copy link
Collaborator

jmatsu-bot commented Jan 16, 2019

@panpanini

This comment has been minimized.

Copy link
Contributor

panpanini commented Jan 16, 2019

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

📝 thats really useful information!! thanks!

@takahirom takahirom added the awesome label Jan 16, 2019

@panpanini

This comment has been minimized.

Copy link
Contributor

panpanini commented Jan 16, 2019

@rnakano

This comment has been minimized.

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

This comment has been minimized.

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

@panpanini
Copy link
Contributor

panpanini left a comment

💯 💯 💯 amazing!

@jmatsu-bot

This comment has been minimized.

Copy link
Collaborator

jmatsu-bot commented Jan 16, 2019

@jmatsu-bot

This comment has been minimized.

Copy link
Collaborator

jmatsu-bot commented Jan 16, 2019

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

This comment has been minimized.

Copy link
Collaborator

jmatsu-bot commented Jan 16, 2019

Asserted successfully. 💯

Generated by 🚫 Danger

@panpanini panpanini merged commit a87b55f into DroidKaigi:master Jan 16, 2019

@rnakano rnakano deleted the rnakano:gzip branch Jan 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.