Open danpe opened 6 years ago
The PBF tiles inside MBTiles are almost always gzipped and most clients (all web browsers, mobile applications, ...) send Accept-Encoding: gzip
as the default.
This is the most efficient way of serving the tiles -- nothing is decompressed, nothing is recompressed and the content is transferred efficiently.
However, this is indeed not entirely correct behaviour. The server should check the Accept-Encoding
header and decompress the content if needed.
I think the quickfix would not work -- it would stop reporting Content-Encoding: gzip
, but the tiles inside mbtiles are usually already compressed.
Proper fix should do two things:
Accept-Encoding
and decompress the tiles on-the-fly (or keep uncompressed -- depending on the PBF header)PR welcome!
The issue description can be found here: https://github.com/CartoDB/mobile-ios-samples/issues/20#issuecomment-416119974
As a quick fix I believe we should move the following lines in serve_data.js
inside
else if (format == 'geojson')
Although the best way of solving this will be checking the
Accept-Encoding
header sent from the client.