-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
server: gzip encoding of tiles #438
Comments
@mojodna the pbf files are already zig zag encoded so I don't know how much of a win gzipping will add, but we can easily add support for handling the |
Gzipping makes a pretty big difference. This tile went from 512K to 125K: |
Well that's pretty significant. I will work on getting it implemented. |
I wrote this up as a new issue, but found this issue already about it. When MVTs were designed, gzipping was intended. This allows use of gzip's property that gzip(file 1 + file 2) = gzip(file 1) + gzip(file 2), and the ability to concatanate multiple layers with MVTs. Mapbox's implementations of consumers and servers assumed that browsers would always request compressed data, server-side software would always process compressed data, and servers would always send compressed data. This assumption was so strong their servers sent compressed data to clients which explicitly said only Tegola should
I'm not sure what this means for setting the Looking at the tiles I'm generating, this would reduce the size from 36MB to 7.6MB of what I get with |
implements gzip compression on successful responses when the Accept-Encoding header is properly set. When leveraging a cache back end for caching tiles the tile data will be compressed prior to writing to the cache. If an incoming request does not support gzip compression the response data will be decompressed prior to responding. NOTE: this commit will break all current caches! It's critical that all caches be purged and rebuilt!
- updated cache/s3 tests - fixed issue with tiles being decompressed when fetched from s3.
gzip compression support #438 implements gzip compression on successful responses when the Accept-Encoding header is properly set. When leveraging a cache back end for caching tiles the tile data will be compressed prior to writing to the cache. If an incoming request does not support gzip compression the response data will be decompressed prior to responding. NOTE: this commit will break all current caches! It's critical that all caches be purged and rebuilt!
When requesting tiles with an
Accept-Encoding: gzip
header, I would expect Tegola to respond with gzipped tiles (and aContent-Encoding: gzip
header) to reduce the amount of data transferred.However, they don't appear to be gzipped:
$ curl -H "Accept-Encoding: gzip" -O http://localhost:8080/maps/borders/11/328/792.pbf % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 9785 0 9785 0 0 10526 0 --:--:-- --:--:-- --:--:-- 10521 $ file 792.pbf 792.pbf: data
Is the intent for Tegola to run behind a reverse proxy that handles gzipping?
The text was updated successfully, but these errors were encountered: