From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?G=C3=A1bor?= Boskovits Subject: bug#37207: guix.gnu.org Last Modified at epoch Date: Wed, 28 Aug 2019 21:42:20 +0200 Message-ID: References: <875zmhliqj.fsf@gnu.org> <877e6xqrtw.fsf@nckx> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000ada420591329775" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45255) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33qR-0006Py-O1 for bug-guix@gnu.org; Wed, 28 Aug 2019 15:43:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i33qQ-0004w5-FW for bug-guix@gnu.org; Wed, 28 Aug 2019 15:43:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i33qQ-0004vw-By for bug-guix@gnu.org; Wed, 28 Aug 2019 15:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i33qQ-0006Sm-7e for bug-guix@gnu.org; Wed, 28 Aug 2019 15:43:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <877e6xqrtw.fsf@nckx> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Tobias Geerinckx-Rice Cc: 37207@debbugs.gnu.org --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--