GNU bug report logs - #58895
GNU ELPA: Stale badges in GitHub cache

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Sun, 30 Oct 2022 15:00:01 UTC

Severity: minor

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58895 in the body.
You can then email your comments to 58895 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#58895; Package emacs. (Sun, 30 Oct 2022 15:00:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefankangas <at> gmail.com>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Sun, 30 Oct 2022 15:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: GNU ELPA: Stale badges in GitHub cache
Date: Sun, 30 Oct 2022 07:59:42 -0700
Severity: minor

I often see stale badges in the GitHub cache, sometimes for several
days.  I think we should use a "Cache-Control" header when serving them:

    $ curl -i https://elpa.gnu.org/packages/url-scgi.svg
    HTTP/1.1 200 OK
    Date: Sun, 30 Oct 2022 14:45:24 GMT
    Server: Apache/2.4.54 (Debian)
    Last-Modified: Sat, 29 Oct 2022 21:04:31 GMT
    ETag: "4c2-5ec32b879e704"
    Accept-Ranges: bytes
    Content-Length: 1218
    Content-Type: image/svg+xml
    [...]

Here, we should also have:

    Cache-Control: max-age=21600, must-revalidate

This should ensure that they are only ever cached for 12 hours, which
roughly coincides with how often we update the archive.

Probably something like this in .htaccess should suffice:

    <FilesMatch ".+\.svg$">
        Header unset Cache-Control
        Header set Cache-Control "max-age=21600, must-revalidate"
    </FilesMatch>

For more, see:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
https://httpd.apache.org/docs/2.4/mod/core.html#filesmatch




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58895; Package emacs. (Sun, 30 Oct 2022 15:23:01 GMT) Full text and rfc822 format available.

Message #8 received at 58895 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 58895 <at> debbugs.gnu.org
Subject: Re: bug#58895: GNU ELPA: Stale badges in GitHub cache
Date: Sun, 30 Oct 2022 11:21:56 -0400
> I often see stale badges in the GitHub cache, sometimes for several
> days.  I think we should use a "Cache-Control" header when serving them:

Hmm... we had a directive for that in Apache's config, but it wasn't
quite right.  It should be working now.
It uses slightly different settings.
You said "12 hours", your code sais 6 hours, and the code we had used
24 hours.  I kept the 24 hours.

Your code said "must-revalidate", the code we had (and still have)
said/says "public".  I think public is right, but I don't really know
what "must-revalidate" (or its lack) implies.


        Stefan





Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Sun, 30 Oct 2022 15:47:02 GMT) Full text and rfc822 format available.

Notification sent to Stefan Kangas <stefankangas <at> gmail.com>:
bug acknowledged by developer. (Sun, 30 Oct 2022 15:47:02 GMT) Full text and rfc822 format available.

Message #13 received at 58895-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 58895-done <at> debbugs.gnu.org
Subject: Re: bug#58895: GNU ELPA: Stale badges in GitHub cache
Date: Sun, 30 Oct 2022 08:46:14 -0700
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Hmm... we had a directive for that in Apache's config, but it wasn't
> quite right.  It should be working now.
> It uses slightly different settings.
> You said "12 hours", your code sais 6 hours, and the code we had used
> 24 hours.  I kept the 24 hours.

Sounds good, thanks.

> Your code said "must-revalidate", the code we had (and still have)
> said/says "public".  I think public is right, but I don't really know
> what "must-revalidate" (or its lack) implies.

From reading the docs, "public" should be fine.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Nov 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 205 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.