api.sl.se/api2/ bör stödja gzip
Borde gå att spara rätt mycket data om servern kunde skicka tillbaka data som gzip om klienten frågar efter det.
Motsvarande interface på Sls hemsida stödjer gzip: http://sl.se/api/sv/RealTime/GetDepartures/9294
Also varför dubbla headers?
Server:Microsoft-IIS/7.5
Server:Microsoft-IIS/7.5
All the best,
Erik
Följ inlägget
0
följare
Hej Erik,
Vi planerar att införa stöd för gzip. Driftsätts november eller december.
/Sabina
Vet inte riktigt vart jag ska rapportera det så postar här.
% curl 'https://api.sl.se/api2/linedata.json?key=&model=jour&DefaultTransportModeCode=BUS' -H 'Accept-Encoding: gzip, deflate' -v 1>/dev/null
> GET /api2/linedata.json?key=&model=jour&DefaultTransportModeCode=BUS HTTP/1.1
> Host: api.sl.se
> User-Agent: curl/7.71.1
> Accept: */*
> Accept-Encoding: gzip, deflate
>
{ [5 bytes data]
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Length: 4263253
< Content-Type: application/json; charset=utf-8
< Expires: -1
< ETag: "3e6eaf5c-7b1e-f093-08bc-696ed270573b"
< Server: Microsoft-IIS/8.5
< server: Microsoft-IIS/8.5
< x-cache-created: 2021-09-01 20:41:37
< x-aspnet-version: 4.0.30319
< x-powered-by: ASP.NET
< X-Powered-By: ASP.NET
< Date: Wed, 01 Sep 2021 18:43:07 GMT
<
% curl 'https://api.sl.se/api2/linedata.xml?key=&model=jour&DefaultTransportModeCode=BUS' -H 'Accept-Encoding: gzip, deflate' -v 1>/dev/null
> GET /api2/linedata.xml?key=&model=jour&DefaultTransportModeCode=BUS HTTP/1.1
> Host: api.sl.se
> User-Agent: curl/7.71.1
> Accept: */*
> Accept-Encoding: gzip, deflate
>
{ [5 bytes data]
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Cache-Control: no-cache
< Pragma: no-cache
< Transfer-Encoding: chunked
< Content-Type: text/xml; charset=utf-8
< Content-Encoding: gzip
< Expires: -1
< ETag: "47f34752-2a46-d5dd-fb33-aa33bac2fccb"
< Vary: Accept-Encoding
< Server: Microsoft-IIS/8.5
< server: Microsoft-IIS/8.5
< x-aspnet-version: 4.0.30319
< x-powered-by: ASP.NET
< X-Powered-By: ASP.NET
< Date: Wed, 01 Sep 2021 18:45:50 GMT
<