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

Ruben L. Mendoza notifications at github.com
Fri Jun 5 23:18:45 UTC 2026


@Rub21 commented on this pull request.



> @@ -36,6 +36,21 @@ def show
 
     private
 
+    # The file is stored gzipped on S3. If the client supports gzip, we send it
+    # as-is and the client unzips it, which saves server CPU and bandwidth.
+    # If the client does not support gzip, the server unzips it before sending.
+    def send_gpx(trace)
+      accepts_gzip = request.accept_encoding.to_s.split(",").any? { |encoding| encoding.split(";").first.strip == "gzip" }

I looked at the docs. It would work, but switching the gem would touch more files across the app, and adding a more generic library just for one line of code does noe feel worth it. I think keeping small is fine for now. 


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

Message ID: <openstreetmap/openstreetmap-website/pull/7124/review/4440388948 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260605/172ae17b/attachment.htm>


More information about the rails-dev mailing list