unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 37207@debbugs.gnu.org
Subject: bug#37207: guix.gnu.org returns Last-Modified = Epoch
Date: Mon, 11 May 2020 11:32:19 +0100	[thread overview]
Message-ID: <87imh2pxsc.fsf@cbaines.net> (raw)
In-Reply-To: <874ksoaym3.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2918 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

> Howdy!
>
> Christopher Baines <mail@cbaines.net> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>> Since the use of the ‘static-web-site’ service, which puts web site
>>> files in the store, nginx returns a ‘Last-Modified’ header that can
>>> trick clients into caching things forever:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> $ wget --debug -O /dev/null   https://guix.gnu.org/packages.json 2>&1 | grep Last
>>> Last-Modified: Thu, 01 Jan 1970 00:00:01 GMT
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> We should tell nginx to do not emit ‘Last-Modified’, or to take the
>>> state from the /srv/guix.gnu.org symlink, if possible.
>>
>> I ended up looking at this again in relation to Repology [1].
>>
>> 1: https://github.com/repology/repology-updater/issues/218#issuecomment-525905704
>>
>> Going back to that comment, given that the Last-Modified header (and the
>> ETag) is wrong, it's probably sensible to remove them. That might even
>> fix the issue with Repology fetching the packages.json file.
>>
>> Alternatively (or in addition), we could run a really simple Guile web
>> server that just serves the packages.json file with the right
>> Last-Modified value, and have NGinx proxy requests to that server. This
>> would be pretty easy to setup I believe, and would allow providing a
>> correct value.
>>
>> Thoughts?
>
> I think it wouldn’t really help because the Last-Modified issue is
> pervasive.  It shows for instance when accessing the web site: one often
> has to force the browser to reload pages to get the latest version.
>
> So I’m all for one of the solutions that were proposed earlier.
>
> WDYT?

So I think removing the Last-Modified header from the responses will fix
the issue with the Repology fetcher (as it will stop thinking it's
already fetch the file, since it was last modified in 1970), instead it
will just always process the file.

Removing the Last-Modified header, and maybe the ETag as well from
responses should avoid the issue with web browsers using a cached
version of the page when they probably shouldn't.

I realise what I described with using a Guile web server to serve the
packages.json file wouldn't help with other pages (unless they're served
as well, which is a possibility), but that was just an optimisation over
removing the header entirely, as having the Last-Modified header, with a
correct value would help the Repology fetcher cache the file.

Does that make sense? It still seems to me that a small change to the
NGinx config (I think these lines somewhere in the config would do it
[1]) would help with the Repology fetcher issue, and the issue you
describe with web browsers.

1:

add_header Last-Modified "";
if_modified_since off;
etag off;

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

  reply	other threads:[~2020-05-11 10:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28  9:52 bug#37207: guix.gnu.org returns Last-Modified = Epoch Ludovic Courtès
2019-08-28 10:40 ` bug#37207: guix.gnu.org Last Modified at epoch Gábor Boskovits
2019-08-28 14:37   ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2019-08-28 19:42     ` Gábor Boskovits
2019-08-28 20:32       ` Ludovic Courtès
2019-08-29  6:11         ` Gábor Boskovits
2019-08-29 12:40           ` Ludovic Courtès
2019-09-05 20:47             ` Ludovic Courtès
2019-09-26  8:39     ` Ludovic Courtès
2019-08-28 15:05   ` Danny Milosavljevic
2019-08-28 18:59     ` Gábor Boskovits
2020-03-26 23:06 ` bug#37207: nginx serving files from the store returns Last-Modified = Epoch Vincent Legoll
2020-03-29  9:50   ` Gábor Boskovits
2020-03-30 11:53     ` Vincent Legoll
2020-03-26 23:30 ` bug#37207: Repology Vincent Legoll
2020-05-09 22:07 ` bug#37207: guix.gnu.org returns Last-Modified = Epoch Christopher Baines
2020-05-10 10:11   ` Ludovic Courtès
2020-05-11 10:32     ` Christopher Baines [this message]
2020-05-11 12:47       ` Ludovic Courtès
2020-05-25  8:24         ` Christopher Baines
2020-05-25  8:20       ` bug#37207: [PATCH] nginx: berlin: Work around Last-Modified issues for guix.gnu.org Christopher Baines
2020-05-15 21:12 ` bug#37207: nginx serving files from the store returns Last-Modified = Epoch anadon via web

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imh2pxsc.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=37207@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).