Closed ndegwamartin closed 1 year ago
Cool, adding this to current milestone
Findings
This header is not present in the download requests Accept-Encoding: gzip
. The OkHttp
client responsible for performing the requests is in the Android FHIR SDK code. FHIRCore HTTP clients will also need to be updated to include this header esp. for the endpoint that returns practitioner-details.
nice, this is kinda a great finding, since we should get a speedup from having gzip on, is there an issue on the SDK yet for this?
No issue yet
Also, NOTE that the SDK provides a NetworkConfiguration for enabling gzip
only for upload requests, defaults to false
. We have overridden this in FHIRCore FhirEngineModule enable gzip
for the upload requests. The implementation can be adopt for download requests in the SDK.
@ellykits based on Aditya's comment on the space gzip is already enabled, https://github.com/square/okhttp/issues/2132#issuecomment-165888326
When a breakpoint is added in the OkHttpCall.java class in the parseResponse function that is part of the Retrofit package, and then run rawResponse.networkResponse(), you will see that in the request headers, gzip is set as the encoding method when running fhir core agaimst the stage server https://fhir.labs.smartregister.org/fhir/Patient?organization=144238&_count=100&_sort=_lastUpdated&_summary=count
cc @ndegwamartin @ellykits
The app is pointing to a non proxy server
Apps pointing to the gateway also have the gzip encoding header as seen below
This issue can be closed. As verified by the screenshots logs shared above by @Rkareko.
Describe the feature request. We need to enforce GZIP for all requests from the android client. This leads to 7x improvements during sync in terms of bandwidth.
Additional context We have confirmed that currently some endpoints do not use
gzip
compression when making requests to the backend e.g custom endpoints during initial sync.Acceptance criteria The app should login and sync down data successfully for all the endpoints/resources.
Area path A list of ordered steps in the app on usage of the feature to support anyone testing it e.g. Code reviewer, QA e.g.
Implementation plan (For Engineers) The plan for implementing the solution e.g. via a description or a check list for the various ordered tasks that will need to be completed.
Accept-Encoding: gzip
on all outgoing requests to the server/practitioner-details
breaks with Gzip configuration