> There is also a GET request to https://news.ycombinator.com/collapse?id=1234567 to save the state of the collapsed/expanded comment if the user is logged in, but it's an async request so it doesn't have an impact. Is this a correct place to use 'GET'?
>Is this a correct place to use 'GET'? Not at all; GET requests are specified [0] to not cause any modifications to the resources (aside of meta-data like logging etc.). It should also be 100% safe for web spiders to issue any GET at any time [1], server overload aside. I presume it's an artifact of earlier implementation -or just an idea- to have the collapse work without JavaScript. It would be doable with a normal…
Why is collapsing a Hacker News comment so slow?
91–100 of 123 posts
Re: Why is collapsing a Hacker News comment so slow?
#92Earlier quoted context omitted.
> If it's your own server you can do whatever you want. This is not at all true. For example, say I'm a user in a dorm that uses a proxy that I have no control over. If you make your GET request modify things, that proxy may cache the request, or worse, may repeat the request later to maintain its cache. My point is, you don't know what is between your server and their client, and even well behaved infrastructure wil…
It's also an issue when you don't even fully control the client, which in this case is the web browser. A game at least behaves exactly as you program it. Browsers are not necessarily consistent, especially when you throw in extensions.
Re: Why is collapsing a Hacker News comment so slow?
#93I would use the tag to solve this problem. Most people don't know this exists and I have no idea why. You would probably have to rewrite the html so it no longer uses tables but I don't really consider that to be a negative. I would also question why we are saving collapsed comments. I feel like this is something that doesn't need to be persisted forever. If you want this behavior why not use local storage instead?
Re: Why is collapsing a Hacker News comment so slow?
#94Re: Why is collapsing a Hacker News comment so slow?
#95Earlier quoted context omitted.
It's really only an issue on mobile when you're collapsing larger threads. Try collapsing the first comment in this thread, for example: https://news.ycombinator.com/item?id=14656945 Not terrible, but there's a noticeable (maybe ~1 second on my phone) delay. My desktop is fast enough that it still feels instant.
One answer to this is to paginate long threads so there's a definite upper limit to the length and depth of the thread on any page.
Re: Why is collapsing a Hacker News comment so slow?
#96Re: Why is collapsing a Hacker News comment so slow?
#97Earlier quoted context omitted.
One answer to this is to paginate long threads so there's a definite upper limit to the length and depth of the thread on any page.
this is a bit ridiculous... folding a few thousand lines of plain text should be fast no matter what. If it isn't, then there's something quite wrong.
Also, I suspect but don't know that the table based layout makes showing and hiding elements a lot slower than it would be with, say, divs or an unordered list. If this is the case, it would probably only be exacerbated on mobile.
Re: Why is collapsing a Hacker News comment so slow?
#98If you don't mind me being negative here for a moment: 1. It's not your website, why spend so much time and effort on dissecting the issue? If one did this for every webpage they visited it'd be a more than a full time job. 2. Does it really look like Hacker News has had any serious development effort poured into it anytime recently? What incentive does YC have to put time and money into a forum that generates zero r…
1) This is a community with a lot of web developers and programmers, and people who have a professional or hobby interest in these problems, and are hanging out here anyway clearly with nothing better to do.
2) We have to do it here because they don't take issues and pull requests.
Re: Why is collapsing a Hacker News comment so slow?
#99I would use the tag to solve this problem. Most people don't know this exists and I have no idea why. You would probably have to rewrite the html so it no longer uses tables but I don't really consider that to be a negative. I would also question why we are saving collapsed comments. I feel like this is something that doesn't need to be persisted forever. If you want this behavior why not use local storage instead?
I can't be the only one who had no idea it did this? And if so, I'd could argue that there isn't really a need for it.
Re: Why is collapsing a Hacker News comment so slow?
#100I suspect the pg answer to this question is "there's too much noise on some posts, and deterring interaction with posts of 300+ comments is a feature, not a bug.