Is it possible to adjust the amount of topics loaded at once for infinite scrolling?

(se oli tonnin seteli) #1

Apparently on mobile some of my users have had trouble skimming through a topic when the site pauses to load more posts all too often. I’ve noticed similar problems with other sites that have implemented infinite scrolling, and it is quite annoying.

I would prefer to be able to adjust how many posts are initially loaded, perhaps even set that the whole topic would be displayed if there were less than twenty or even thirty posts or something similar to that, and also how many topics are loaded when reaching the end of displayed posts.

During my commute there are a couple of places where connection is lost, and connection loss is almost unbearably common when travelling long distances by train around here, so this would probably help a lot in those situations.

Any suggestions?

1 Like
(Jeff Atwood) #2

On Android, you will literally cripple devices if you load 30 or more posts at once. Would be ok on iOS for the most part. We do not allow control of this because people set it to values that cause a catastrophically bad user experience. Which we get blamed for.

Search for Android and slow here if you wish to learn more.

4 Likes
(Jeff Atwood) #3

Update, this is far less dangerous as of Discourse 1.5 and later, but I would think long and hard about old, crappy Android devices before raising this setting too high.

5 Likes
(se oli tonnin seteli) #4

Thanks for the update :slight_smile:

In my case old devices are not a problem though. I think that if we’re talking topics that contain mostly text (our cat picture topic is sluggish already so I do understand your point quite well…) it would be nice if more posts were loaded at once, or if this value would be somehow adjustable to better suit site’s topic content in general.

PS. I just noticed that I kept confusing topic and post in the original post, even in the topic title, sorry about that…

2 Likes
(Dan Fabulich) #5

I’m also interested in this. Jeff warns against changing the setting, but I don’t see a way to actually set it.

It seems like the current page size is 20 posts per page? In particular, it would be great to crank the page size up to 50 on mobile devices and 100 on desktop browsers.

(Rafael dos Santos Silva) #6

It’s not a setting. We did double the number of loaded posts per chunk in Android on this release already.

Also, since this topic was created, we added the timeline on mobile, so you can quickly jump around too.

2 Likes
(Dan Fabulich) #7

What is the current chunk size on desktop/mobile? I did my testing on desktop and it seemed to be 20; I’d like it to be 100 on desktop Chrome.

(Stephen) #8

What’s the motivation for this, are you noticing stuttering?

Users don’t typically read 100 posts at a time, you’re guaranteed to burn a lot of resources unnecessarily this way by pulling down so many posts in one hit. There are UX implications too, the scroll bar handle will become much smaller as a result of the increased page height.

1 Like
(Dan Fabulich) #9

Yes, I do notice stuttering, particularly when on a train, as se oli tonnin steteli said in the #1 post on this thread.

I think reading several dozen posts is not at all uncommon. 20 is quite small!

(Stephen) #10

Looking at a lot of the communities I work with, many of their topics don’t reach 20 posts, in those cases the entire topic would be loaded. I’m not sure on how the figure of 20 was reached, but on old crusty forum software which didn’t feature infinite scrolling it was quite typical to see 20-25 posts per-page.

You’re going to burn even more resources by loading as much as 5x as many posts to all of your users.

This sounds like a network issue and a potential performance problem than a fix.

(Dan Fabulich) #11

On a train, it’s absolutely a network issue, but it may not have a feasible solution.

Whereas increasing the chunk size sounds pretty doable. 5x resources may be fine, depending on how low X is.

(Jeff Atwood) #12

As long as you’re not on our hosting, you can possibly do that – but I wouldn’t support it on our hosting service for the reasons @Stephen outlined.

1 Like
(Dan Fabulich) #13

Thanks! How would I do that on a non-CDCK hosted forum?

(Jeff Atwood) #14

Looks like you’d need to write a plugin. I could have sworn we did have a setting here, but I just checked and I guess @sam removed it in a recent cleanup when we normalized Android chunk size loading behavior?

(Sam Saffron) #15

I am not sure we ever had a site setting. A change to chunk size would also mean page size would change, which in turn would leave google with a pretty corrupt index. Decoupling page we show google from chunk size would require a bit more work. This is all feasible in a plugin but mega hacky

1 Like
(Dan Fabulich) #16

I don’t care about Google’s index in this case. Where would I look for this?

(Sam Saffron) #17

I think it is this guy:

But really we need to re-design our API and client a bit so the client tells the server how many posts it wants in the chunk, then a trivial theme component could alter the behavior.

3 Likes