From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id GG1hBWdnW2XvqwAAauVa8A:P1 (envelope-from ) for ; Mon, 20 Nov 2023 15:04:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GG1hBWdnW2XvqwAAauVa8A (envelope-from ) for ; Mon, 20 Nov 2023 15:04:23 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ECC5467B3A for ; Mon, 20 Nov 2023 15:04:22 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail3 header.b=EZQQubil; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1700489063; a=rsa-sha256; cv=none; b=CI6vcSZK26bQxZWsTlzZZowuttLOYarw/kWJuVcwYu/DbO2y4uZ/lu5Z2iHGLAqqgH+oaW td97KY/WzGUNToZ+UzEh0ShtgMtjHJsO5lSCfBUqWscY9z34Xx+HjuNXg6a1D0EmHnzUk/ F6LqIhm+mlfS452cFtAQmKicaDkB1KpB+qqs+gF5UFOTtt5bo+UQXcoEs9pIXYM7sbXaSc f2fFr34npPlv0zBAr8zGyuW4SUUNq+833ApeUHFSToK5+ejppY0Mwv0uITILfj/MhjYkv6 la53X20fzQkdPZ6YUDRO6+XJuYxOYswnqT8I5ZfcBRQTr0pnV1zO0fx9lLsZ3A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail3 header.b=EZQQubil; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700489063; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=YFxz8paLtIrbJq7f5LSd5k+gVdMG4Z3fNUaeylaHIWA=; b=HfmJ2+eRd/g/gkuvkclBsrQSifZSydret9WOkczr+MiHUV3+xkwQos9gnv5lZZYbUQC6j0 0/i6UADi8yXsUwfOMmvkOBkuJkOoHY27SWX0zGz1jAWs1afMS837C/JI9kZEXBkhWMHnX1 mzx1KHeYy0v3+HyFiJuqadn9ZiE1ACGLRIbP+KDpokSJS9GEj+ogIwT8IJVJmU8bBxk8tq cjicWpA7ZiYEfkbzWVEJHTbd9udZhqWeHDavApNl8C1mgqr7gjECtqKtkjFuJwEG8/fyQg rpUz7/XstFO/cne2g8RRGqVpnwn3/1orVuWeOMEbyvNQYhw+mNa6xHEhhQhECQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r54sD-0007ha-EE; Mon, 20 Nov 2023 09:03:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r54sA-0007fz-3F for guix-devel@gnu.org; Mon, 20 Nov 2023 09:03:34 -0500 Received: from mail-4317.proton.ch ([185.70.43.17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r54s5-0007qY-Vg for guix-devel@gnu.org; Mon, 20 Nov 2023 09:03:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1700489004; x=1700748204; bh=YFxz8paLtIrbJq7f5LSd5k+gVdMG4Z3fNUaeylaHIWA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=EZQQubilgScskwnt2sJVTxPo39dF7wWCslUGiyiPk586/ljux1QjwcBw9qg6lPdSy DXtMZOnZPfxosMiqpIcN1sLZaz1ip+FF/Is91KtfZbAR57YhaMzkSrfQrQdOY7915z XdfdeV/Sfh3v6X5KbAcsIKgXJMusX75W39mjQ2vo3Qeff0au3+XyZln3et4DgbLbBg HOXRqE3MnzCw1SIvXgXSkE5unmH0WUS5I+NG4C4Y37b8KTyLRK4vFdONyN54/5qW9X g0yzjF/drkoFmjbfoD9uTV3/nxEqkAAD0O+ZbR33lpdYpboBgCSGqfqub0K6KlaVdw H3eEPl3IPoyWw== Date: Mon, 20 Nov 2023 14:03:13 +0000 To: Simon Tournier From: Attila Lendvai Cc: Guix Devel Subject: Re: [maintenance] Compressed JSON files and served file extension? Message-ID: In-Reply-To: <861qe03rtj.fsf@gmail.com> References: <861qe03rtj.fsf@gmail.com> Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.17; envelope-from=attila@lendvai.name; helo=mail-4317.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: ECC5467B3A X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.11 X-Spam-Score: -5.11 X-TUID: 4Okdz5IaeEiY TL;DR the filename shouldn't contain the .gz extension, and the HTTP standa= rd is crap ("If no Accept-Encoding field is present in a request, the serve= r MAY assume that the client will accept any content coding."). use curl --compressed the details: the Content-Encoding response header instructs the client on how to decode = the __transfer payload__ that the server is serving. i.e. proper HTTP clients should automatically decode the content as instruc= ted by the Content-Encoding response header, or at the very least warn that= they do not understand the response encoding... but that should not happen, because the HTTP request can contain an Accept-= Encoding header that tells the server what the client understands, and it d= efaults to unprocessed raw data ('identity')... except that the standard allows the server to ignore the Accept-Encoding re= quest header. well, this is the theory, but both wget and curl don't automatically decode= the content. curl at least can be instructed to do so, which arguably shou= ld be its default: curl --compressed https://guix.gnu.org/sources.json | less --verbose can be used to inspect the reques/response headers (printed to st= derr): curl --verbose https://guix.gnu.org/sources.json >/dev/null curl --verbose --compressed https://guix.gnu.org/sources.json >/dev/null here's a detailed discussion of this very question: https://stackoverflow.com/questions/8364640/how-to-properly-handle-a-gzippe= d-page-when-using-curl so, in an ideal world wget and curl should transparently decode the content= according to the Content-Encoding response header, and nginx should not re= spond with a compressed content when the client is not sending an Accept-En= coding request header. the pragmatic solution is to use curl --compressed in scripts, and/or add i= t to your ~/.curlrc: # to automatically decode responses with some of # the supported Content-Encoding compressed HTH, -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CWe need people in our lives with whom we can be as open as possibl= e. To have real conversations with people may seem like such a simple, obvi= ous suggestion, but it involves courage and risk.=E2=80=9D =09=E2=80=94 Thomas Moore (1940=E2=80=93)