[openstreetmap/openstreetmap-website] Compress plain GPX uploads with gzip (PR #7124)

Ruben L. Mendoza notifications at github.com
Tue Jul 7 23:56:39 UTC 2026


Rub21 left a comment (openstreetmap/openstreetmap-website#7124)

I ran this on a deploy with GpxS3. I uploaded a plain [GPX of about 200 KB.](https://github.com/user-attachments/files/29776313/routes.gpx.zip) On S3 it is stored gzipped, only 22.7 KB, and with the Content-Encoding: gzip header.

<img width="1343" height="462" alt="618510030-fe09198f-6479-439e-9593-7d210ad6d056" src="https://github.com/user-attachments/assets/e69cfc64-51d2-4478-b278-586d97dc914c" />


<img width="1380" height="546" alt="Screenshot 2026-07-07 at 6 23 04 PM" src="https://github.com/user-attachments/assets/e50bc7b2-5cac-4357-bd00-0816abb8a33c" />

https://osm-s3-website-dev.s3.us-east-1.amazonaws.com/krivwyyrck6usfbhjgmugyh461p2

On download, a browser gets the small file from S3 and unzips it on its own, so it still receives a normal GPX. A client that does not accept gzip gets the plain file, the server unzips it first. Either way the file is the same one I uploaded.


```bash
BASE=https://compress-gpx-uploads.167.233.138.142.nip.io

# like a browser: it fetches the small gzipped file and unzips it
> curl -s --compressed -L "$BASE/traces/2/data" -o out.gpx -w "on the wire: %{size_download} bytes\n"
# on the wire: 23202 bytes

# see the header S3 sends
> curl -s -H "Accept-Encoding: gzip" -D - -L "$BASE/traces/2/data" -o /dev/null | grep -i content-encoding
# content-encoding: gzip

# a client without gzip: the server unzips it and sends the plain 200 KB
curl -s -H "Accept-Encoding: identity" -L "$BASE/traces/2/data" -o plain.gpx -w "on the wire: %{size_download} bytes\n"
# on the wire: 200176 bytes
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7124#issuecomment-4910101654
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7124/c4910101654 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260707/928c398a/attachment.htm>


More information about the rails-dev mailing list