Why Nostr? What is Njump?
2024-08-02 14:27:34
in reply to

CXPLAY on Nostr: njump's recent strategy for fetching the latest notes from authors has made RSS feed ...

njump's recent strategy for fetching the latest notes from authors has made RSS feed very fragile. Simply put, njump now prioritizes fetching author notes from the local cache database, but if someone uses njump to open a new note that is not in the cache database before the cache is refreshed, the sorting of the RSS feed is broken and the timeline in the RSS is no longer complete until the cache is refreshed.
但是只要事件在 24 小时刷新间隔内被提前缓存进了本地数据库, 这个 RSS/Atom 路由生成输出的时候就会立马读取, 比如有人主动用 njump 预览了一个还没有进入缓存的作者的事件, 那这个 RSS/Atom Feed 排序就直接乱掉了, 而没有被主动用 njump 预览过的事件就不会进入 Feed.
现在魔改了一下, 把 RSS/Atom 路由单独进行单独的判断, 不缓存也不从本地数据库读缓存事件, 每次有请求才立马从预设的外部中继里请求并生成 Feed, 请求数量也从默认的 100 条调到了一般 RSS Feed 常用的 20 条. :eveonecat_coffeebath: (实际生成 Feed 的的 entry 数量可能会多于这个数)
虽然 njump 给 Feed 的 .xml 设置了缓存控制标头, 但是基本上绝大多数的 RSS 阅读器都不会遵守, 于是还得用 CDN 强行给 .xml 缓存一遍(虽然缓存标头还是遵守源服务器).
PS: 总感觉还会有什么奇怪bug.
Author Public Key
npub1gd8e0xfkylc7v8c5a6hkpj4gelwwcy99jt90lqjseqjj2t253s2s6ch58h