-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Maybe it will be useful to add gzip compression for response.
I asked WS why some requests like this takes 5 minutes
https://api.wheel-size.com/v1/search/by_model/?make=bmw&model=5-series&year=2007&user_key=
And a part of the answer was:
An easy and convenient way to reduce the bandwidth and response time needed for each request is to enable gzip compression. In order to receive a gzip-encoded response you must do the following thing: Set an Accept-Encoding header:
Accept-Encoding: gzip
So I add in Configuration.php new protected variable and set and get function for it.
protected $acceptEncoding="gzip";
And in SearchApi
if ($this->config->getAcceptEncoding()) {
$defaultHeaders['Accept-Encoding'] = $this->config->getAcceptEncoding();
}
But may be you can add it in other methods and other classes.
Please excuse me if this already exists but i haven't found it
Regards