You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NRSS does not work as well as it should because it gets rate limited by NRK's servers. The current implementation always hits NRK's servers every time a client tries to fetch a feed through the NRSS API (which in turn calls NRK's API). @timharek suggested that Deno KV can be used to store data here, and fetched periodically with Deno Cron. While I believe this is a good idea, I suggest that we fetch the latest episodes on demand, not periodically. Additionally, we can use Deno's queueing system to fetch historical episode data without 1) blocking the user/podcatcher and 2) hitting NRK too hard.
Data requirements
This is the data we use to generate an entry in a podcast feed, which we'd need to store.
sequenceDiagram
podcatcher ->> nrss: GET /feed
alt feed in db AND last fetched <= 1h?
nrss --> podcatcher: return the feed
else
nrss ->> nrk: GET _latest_ episodes
nrk --> nrss: episode data
nrss ->> nrss: store unseen episodes
note right of nrss: do in the background
nrss ->> nrss: Deno Queue job to download historic episodes
nrss --> podcatcher: return the feed
end
Loading
Getting historic data
sequenceDiagram
note right of nrss: might have to spend time here, to avoid rate limits etc.
nrss ->> nrk: GET _all_ episodes
nrss --> nrss: store old episodes in the feed
Subtasks
Description
NRSS does not work as well as it should because it gets rate limited by NRK's servers. The current implementation always hits NRK's servers every time a client tries to fetch a feed through the NRSS API (which in turn calls NRK's API). @timharek suggested that Deno KV can be used to store data here, and fetched periodically with Deno Cron. While I believe this is a good idea, I suggest that we fetch the latest episodes on demand, not periodically. Additionally, we can use Deno's queueing system to fetch historical episode data without 1) blocking the user/podcatcher and 2) hitting NRK too hard.
Data requirements
This is the data we use to generate an entry in a podcast feed, which we'd need to store.
Getting feed / on demand storing
This is the storage flow I imagine.
sequenceDiagram podcatcher ->> nrss: GET /feed alt feed in db AND last fetched <= 1h? nrss --> podcatcher: return the feed else nrss ->> nrk: GET _latest_ episodes nrk --> nrss: episode data nrss ->> nrss: store unseen episodes note right of nrss: do in the background nrss ->> nrss: Deno Queue job to download historic episodes nrss --> podcatcher: return the feed endGetting historic data
sequenceDiagram note right of nrss: might have to spend time here, to avoid rate limits etc. nrss ->> nrk: GET _all_ episodes nrss --> nrss: store old episodes in the feedEDIT: added subtasks.