Lag whilst using a VPN
Whilst I'm connected to a VPN the main feed as well as individual comments take much longer to load, despite them loading instantly if I browse using the website or Hacki instead.
https://news.ycombinator.com/item?id=31549238 this page for instance took 10 seconds to load all the comments, during which time the comments can't be browsed at all, in contrast to instant loading on the two aforementioned alternatives.
Hmm. The Hacker News API works by individually requesting every item. This introduces a lot of parallel requests. If I had to guess, I'd say not all VPNs appreciate this many simultaneous requests. Some requests taking longer than others is mostly fine for the main page, but comment threads can be an issue because comments are only rendered if all of the comments above them have been retrieved. This can create a bottleneck where almost the entire page is waiting for a delayed comment request at the top of the page.
If this is indeed the problem, I'd need to reconsider the current tree traversal implementation.
I'm interested in hearing if there's any significant difference in the just released version v1.18.1. Loading the comment tree still occurs by requesting individual items, but two changes might influence the results:
- Comments can be rendered out-of-order. So one slow request should not hold up the rest.
- A maximum of 8 parallel requests are executed to retrieve the comment tree. This value works well for me, but is not set in stone and could be adjusted if it benefits users.
Thanks, will check it out when it's available on F-Droid.
Closing this because there have not been recent reports stating that this is a current issue.