From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 28 15:42:40 2019 Received: (at 37207) by debbugs.gnu.org; 28 Aug 2019 19:42:40 +0000 Received: from localhost ([127.0.0.1]:51243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i33q4-0006S7-3J for submit@debbugs.gnu.org; Wed, 28 Aug 2019 15:42:40 -0400 Received: from mail-ed1-f48.google.com ([209.85.208.48]:35066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i33q2-0006Rt-0Y for 37207@debbugs.gnu.org; Wed, 28 Aug 2019 15:42:38 -0400 Received: by mail-ed1-f48.google.com with SMTP id t50so1331282edd.2 for <37207@debbugs.gnu.org>; Wed, 28 Aug 2019 12:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LcVeZZqcVZDBwdVhTGz86q4Fr8sVupTjED0IpGh1yx0=; b=riD7F3nEclNdu17jA6BpbC0PWrcageG2S7ZptbLN4VHI7jJaNsd4fPdx8kEyNzaTxH QlqkKbS/0P7HVfJw7GhSuKfgeRGbLTqirvdpgfNMPAbkh3bkXrcnNGkO98JatSaqtOw5 hm+WBobhXfZaoLqDVaHoWRJtiBo2AEByDh3uuNAPEYEwLez7w2bwqtVNNBhw4u8DqYzL awMwog3a38xcCjvAWs5s+ey7Z0zAxYDjnPA7JzAY66oWWvxe2RyytSiYKc7lhaiB7cqN WeueWMVPc3Lc/LzA3daZ8SfrirRTfU3oVETeiCUTPWyKPxUiyN/b4htgn3UD07uWBXLs KgDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LcVeZZqcVZDBwdVhTGz86q4Fr8sVupTjED0IpGh1yx0=; b=IxyPzx4VItZwtosYCBfGSyEi2SaEhYWk34Qlc4SrJEcgUNsWBe2wK3WCPLXlU3ZHWx zk1cK/PAK3WGGWPj2foqHhmJtEVlPRBPzQFrdJRXu3qt5bKjyM+KWuI617jLZycjU78e MV6I8+LFcL7ZaFGzyckDt3cQJd3vsS8ZhONsl3cGUwsU1BFb2y7Cb8BAo2gfwujlwyvJ Pfp5R51wbi70gXBatbWejBh+O21x6+FoWtO/qdIdQCsWYwSoktKbJoC/TS5Fh7KpFzPa pTtkmJd834kNyDbKWANHAC2+CUVOyrFIDPUzJJ6JhaS54jrFD0BerHJfF559cttKi5h9 Jibw== X-Gm-Message-State: APjAAAXH5/By71s5rG2MUAjq95Zed0L7a7hpOy93pwHYrf5VoTkfothO gvwe4TAg9aefhV1IsTgXFt9j+6foYglGj8ZAsQ== X-Google-Smtp-Source: APXvYqzZV0h4UoQg614QHHDHcbWmWin6ODXF0TvtJpfR7VgKH29Gq72+kjz4ZuiA5eCRp+UBT/IHZJoAeQ5HmTRDR7M= X-Received: by 2002:a50:86c9:: with SMTP id 9mr5959997edu.10.1567021352014; Wed, 28 Aug 2019 12:42:32 -0700 (PDT) MIME-Version: 1.0 References: <875zmhliqj.fsf@gnu.org> <877e6xqrtw.fsf@nckx> In-Reply-To: <877e6xqrtw.fsf@nckx> From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Wed, 28 Aug 2019 21:42:20 +0200 Message-ID: Subject: Re: bug#37207: guix.gnu.org Last Modified at epoch To: Tobias Geerinckx-Rice Content-Type: multipart/alternative; boundary="0000000000000ada420591329775" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 37207 Cc: 37207@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000000ada420591329775 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Tobias, Tobias Geerinckx-Rice via Bug reports for GNU Guix ezt =C3=ADrta (id=C5=91pont: 2019. aug. 28., Sze, 16:38): > G=C3=A1bor, Ludo', > > G=C3=A1bor Boskovits =E5=86=99=E9=81=93=EF=BC=9A > > Supressing the last modified header is just an > > add_header Last-Modified ""; > > away. > > You'll also need: > > # Don't honour client If-Modified-Since constraints. > if_modified_since off; > # Nginx's etags are hashes of file timestamp & file length. > etag off; > > You really have a point here. Based on my reseach, I came up with the following: we need etag off; we should create a file with the git last modification time of the files, updated when there is a new commit in the repo =3D> last-modified we should create a file with some hash of the files, updated when there is a new commit in the repo =3D> etag we could restrict these operations to the files modified since the last checkout. Retrieve these with embededd perl. Wdyt? > Turning these off will of course prevent all caching. I don't > know if that would add measurable load to guix.gnu.org (it would > be more problematic if we used a CDN, but it might still make a > difference). > > Nix does something both interesting and icky =E2=80=94 as always: patch[0= ] > nginx to look up the realpath() instead, so clients can still > cache using If-None-Match. > > Kind regards, > > T G-R > > [0]: https://github.com/NixOS/nixpkgs/pull/48337 > Best regards, g_bor --=20 OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21 --0000000000000ada420591329775 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Tobias,

Tobias Geerinckx-Rice vi= a Bug reports for GNU Guix <bug-guix= @gnu.org> ezt =C3=ADrta (id=C5=91pont: 2019. aug. 28., Sze, 16:38):<= br>
G=C3=A1bor, Ludo= ',

G=C3=A1bor Boskovits =E5=86=99=E9=81=93=EF=BC=9A
> Supressing the last modified header is just an
> add_header Last-Modified "";
> away.

You'll also need:

# Don't honour client If-Modified-Since constraints.
if_modified_since off;
# Nginx's etags are hashes of file timestamp & file length.
etag off;


You really have a point here.

Based on my reseach, I came up with the following:

we need
etag off;

we s= hould create a file with the git last modification time of the files, updat= ed when there is a new commit in the repo =3D> last-modified
we should create a file with some hash of the files, updated when there = is a new commit in the repo =3D> etag
we could restrict these = operations to the files modified since the last checkout.

Retrieve these with embededd perl.
Wdyt?
<= div class=3D"gmail_quote">
=C2=A0
Turning these off will of course prevent all caching.=C2=A0 I don't know if that would add measurable load to guix.gnu.org (it would
be more problematic if we used a CDN, but it might still make a
difference).

Nix does something both interesting and icky =E2=80=94 as always: patch[0] =
nginx to look up the realpath() instead, so clients can still
cache using If-None-Match.

Kind regards,

T G-R

[0]: https://github.com/NixOS/nixpkgs/pull/48337

Best regards,
g_bor

--
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:= CF63:0B21
--0000000000000ada420591329775--