Disabling newsreader short term caching for creative nntp uses #illuminant #gnus #nntp

When I abuse bend nntp creatively, sometimes there is a slight impedance mismatch between what a newsreader assumes and what I need.
Case in point: in traditional news (and mail), articles don't change. So keeping them in memory is a nice way to improve user experience. But for my ActivityPub server, Illuminant, articles do (slightly) change - for instance when a Like (star) or Repeat (boost) activity arrives. I could have implemented those arrivals by superseding the article in question, but that would make Likes and Repeats quite noisy (similar to getting a notification for each in, say, Mastodon), and I like that they are not grabbing a lot of attention.
Instead articles just have a header that shows the current Likes and Repeats, so when my newsreader, Gnus, keeps the article in memory, it is effectively hiding any updates.
So I went on a quest to figure out how to disable this; here is the solution I arrived at:
- In the Topic Parameters of the fediverse topic, I added
(gnus-keep-backlog nil) - In
~/.gnusI do this:
(defun asjo-gnus-flush-original-article-buffer (&optional arg)
"To force reloading from server (if gnus-keep-backlog is nil)."
(gnus-flush-original-article-buffer))
(advice-add 'gnus-summary-show-article :before #'asjo-gnus-flush-original-article-buffer)
Gnus defaults to keeping the latest 20 articles in a backlog, so I disable that.
It also keeps the latest original article around in a buffer, so even with the backlog disabled, Gnus won't reload the same article over nntp again, as it just gets it from the original article buffer - I didn't find a way to turn this off, so instead I flush it just before showing an article. Less elegant, but it works.
Add comment
How to comment, in excruciating detail…
To avoid spam many websites make you fill out a CAPTCHA, or log in via an account at a corporation such as Facebook, Google or even Microsoft GitHub.
I have chosen to use a more old school method of spam prevention.
To post a comment here, you need to:
- Configure a newsreader¹ to connect to the server
- Open the newsgroup called
¹ Such as Thunderbird, Pan, slrn, tin or Gnus (part of Emacs).koldfront.dkon port1119using nntps (nntp over TLS).lantern.koldfrontand post a follow up to the article.Or, you can fill in this form: