kssytsrk / nx-freestance-handler

nx-freestance-handler, a redirector from the mainstream sites (Youtube, Twittter, Instagram, Reddit) to their privacy-supporting mirrors
GNU General Public License v3.0
28 stars 3 forks source link

invidious-handler: Cache invidious instances. #16

Closed aartaka closed 2 years ago

aartaka commented 2 years ago

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

Does that look sane?

kssytsrk commented 2 years ago

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?

aartaka commented 2 years ago

Yes, it does!