* bug#58895: GNU ELPA: Stale badges in GitHub cache
@ 2022-10-30 14:59 Stefan Kangas
2022-10-30 15:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2022-10-30 14:59 UTC (permalink / raw)
To: 58895; +Cc: Stefan Monnier
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#58895: GNU ELPA: Stale badges in GitHub cache
2022-10-30 14:59 bug#58895: GNU ELPA: Stale badges in GitHub cache Stefan Kangas
@ 2022-10-30 15:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-30 15:46 ` Stefan Kangas
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-30 15:21 UTC (permalink / raw)
To: Stefan Kangas; +Cc: 58895
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#58895: GNU ELPA: Stale badges in GitHub cache
2022-10-30 15:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-10-30 15:46 ` Stefan Kangas
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2022-10-30 15:46 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 58895-done
Stefan Monnier <monnier@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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-30 15:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-30 14:59 bug#58895: GNU ELPA: Stale badges in GitHub cache Stefan Kangas
2022-10-30 15:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-30 15:46 ` Stefan Kangas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).