Hi @kssytsrk, thanks for your work on nx-freestance-handler! Using it every day and it works worderfully :D
Motivation
One thing that was ticking my curiosity was a noticeable one-second slowdown when requesting redirectable YouTube link. The reason was the dex:get call in get-invidious-instances, the result of which didn't seem to be cached and thus requested instances repeatedly with every YouTube request (of which there can be many). That's why this patch -- to cache Invidious intances that are already there, so that redirects are faster and smoother.
Things to discuss
Is one day a reasonable cache expiration period? Are Invidious instances changing often? I am unaware of their takedowns, so I was basically guessing there.
Also, note that the cache is updated at every browser restart, which should more or less help with keeping it fresh -- I, for example, use Nyxt in one-two-hour sessions, closing it afterwards.
Hi, this looks good. Sadly I don't have the ability to test this on Nyxt right now, and since you seem fairly active with developing and using Nyxt, please just tell me: does this work on master?
Hi @kssytsrk, thanks for your work on nx-freestance-handler! Using it every day and it works worderfully :D
Motivation
One thing that was ticking my curiosity was a noticeable one-second slowdown when requesting redirectable YouTube link. The reason was the
dex:get
call inget-invidious-instances
, the result of which didn't seem to be cached and thus requested instances repeatedly with every YouTube request (of which there can be many). That's why this patch -- to cache Invidious intances that are already there, so that redirects are faster and smoother.Things to discuss
Does that look sane?