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

Pablo Brasero notifications at github.com
Mon Jun 22 09:21:00 UTC 2026


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

> Why do we need to monkey patch rails?

It's not a monkey patch. The PR introduces a new storage adapter (`ActiveStorage::Service::GpxS3Service`) that inherits from an existing one (`ActiveStorage::Service::S3Service`).

> Can somebody explain how GpxS3Service even gets invoked?

Set `service: GpxS3` in `storage.yml`. I think that the new adapter exists in the ActiveStorage namespace so that it can be referenced here. No idea if different naming is possible. This PR is missing a change to the example file and a mention in the docs.

It's true that the code changes make the objective of this PR a bit unclear. The objective is making it so that we compress GPX files on upload (unless already compressed), in such a way that doesn't require us to decompress them back when serving them, because we delegate decompression to browsers via `Content-Encoding`.

For comparison, I have a GPX file here (taken from the website at random) that compresses from 341kB to 24kB. Having said that, I don't know what the storage impact would be overall as I don't know how frequently users upload plain GPX files as opposed to compressed ones.

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

Message ID: <openstreetmap/openstreetmap-website/pull/7124/c4766771106 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260622/2f7225c4/attachment-0001.htm>


More information about the rails-dev mailing list