Ask PG: Displaying number of comments on HN posts
PG, could you please explain how HN decides when to show/hide the total number of comments on a post?
When there are 0 comments on a story, the link is shown as "discuss". The link changes to "1 comment" or "N comments" for N>1. However, at some point, it changes just to "comments" with no number shown.
As far as I can tell, the change is independent of the number of comments and there doesn't seem to be any particular length of time from when the story was submitted that triggers the change. The behaviour also seems to be different depending on whether you are logged in or not.
I know it is only a minor aspect of the site, but I have been curious about how it works for a while. Also, what was the logic (if any) in taking this approach?
3 comments
[ 3.2 ms ] story [ 20.9 ms ] threadChanges in behaviour when logged out are likely due to caching. We can cache the logged-out pages more aggressively since they're shared by all logged-out users.