Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. #ActivityPub developers only please: how many items should be in a full collection page?

#ActivityPub developers only please: how many items should be in a full collection page?

Scheduled Pinned Locked Moved Uncategorized
activitypub
26 Posts 8 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • evan@cosocial.caE evan@cosocial.ca

    #ActivityPub developers only please: how many items should be in a full collection page?

    julian@activitypub.spaceJ This user is from outside of this forum
    julian@activitypub.spaceJ This user is from outside of this forum
    julian@activitypub.space
    wrote last edited by
    #3

    @evan@cosocial.ca I don't support polls on NodeBB yet so can't vote, but...

    Default perPage is 20*. This is configurable in the admin control panel.

    * except for user outboxes. That uses a cursor, not pages.

    1 Reply Last reply
    1
    0
    • smallcircles@social.coopS This user is from outside of this forum
      smallcircles@social.coopS This user is from outside of this forum
      smallcircles@social.coop
      wrote last edited by
      #4

      @julian @evan

      There is no option "it depends.. ". Shouldn't this depend on what you intend to use the collection for? A design choice depending on your use case and domain model.

      Or is the missing context to the poll's question is "..in a typical fediverse microblogging environment"?

      smallcircles@social.coopS evan@cosocial.caE 2 Replies Last reply
      0
      • smallcircles@social.coopS smallcircles@social.coop

        @julian @evan

        There is no option "it depends.. ". Shouldn't this depend on what you intend to use the collection for? A design choice depending on your use case and domain model.

        Or is the missing context to the poll's question is "..in a typical fediverse microblogging environment"?

        smallcircles@social.coopS This user is from outside of this forum
        smallcircles@social.coopS This user is from outside of this forum
        smallcircles@social.coop
        wrote last edited by
        #5

        @julian @evan

        Well.. atm all options have 25% of the vote ๐Ÿ˜…

        1 Reply Last reply
        1
        0
        • smallcircles@social.coopS smallcircles@social.coop

          @julian @evan

          There is no option "it depends.. ". Shouldn't this depend on what you intend to use the collection for? A design choice depending on your use case and domain model.

          Or is the missing context to the poll's question is "..in a typical fediverse microblogging environment"?

          evan@cosocial.caE This user is from outside of this forum
          evan@cosocial.caE This user is from outside of this forum
          evan@cosocial.ca
          wrote last edited by
          #6

          @smallcircles @julian

          Link Preview Image
          Poll FAQ

          I do a lot of polls on my account at Mastodon. I get the same questions or requests multiple times, so I made this FAQ to make it easier to reply. Q: Why do you do so many polls? A: I like to think about topics big and small, from the things we wear andโ€ฆ

          favicon

          Evan Prodromou's Blog (evanp.me)

          1 Reply Last reply
          1
          0
          • evan@cosocial.caE evan@cosocial.ca

            #ActivityPub developers only please: how many items should be in a full collection page?

            deadwisdom@fosstodon.orgD This user is from outside of this forum
            deadwisdom@fosstodon.orgD This user is from outside of this forum
            deadwisdom@fosstodon.org
            wrote last edited by
            #7

            @evan Totally depends on the collection, shouldn't it?

            1 Reply Last reply
            0
            • evan@cosocial.caE evan@cosocial.ca

              #ActivityPub developers only please: how many items should be in a full collection page?

              naturzukunft2026@mastodon.socialN This user is from outside of this forum
              naturzukunft2026@mastodon.socialN This user is from outside of this forum
              naturzukunft2026@mastodon.social
              wrote last edited by
              #8

              @evan configurable ๐Ÿ˜€

              evan@cosocial.caE 1 Reply Last reply
              0
              • evan@cosocial.caE This user is from outside of this forum
                evan@cosocial.caE This user is from outside of this forum
                evan@cosocial.ca
                wrote last edited by
                #9

                @squinky dude

                1 Reply Last reply
                1
                0
                • naturzukunft2026@mastodon.socialN naturzukunft2026@mastodon.social

                  @evan configurable ๐Ÿ˜€

                  evan@cosocial.caE This user is from outside of this forum
                  evan@cosocial.caE This user is from outside of this forum
                  evan@cosocial.ca
                  wrote last edited by
                  #10

                  @naturzukunft2026 great. What's the default? And what *should* the value be? It's an opinion poll; have an opinion.

                  naturzukunft2026@mastodon.socialN 1 Reply Last reply
                  0
                  • evan@cosocial.caE evan@cosocial.ca

                    @naturzukunft2026 great. What's the default? And what *should* the value be? It's an opinion poll; have an opinion.

                    naturzukunft2026@mastodon.socialN This user is from outside of this forum
                    naturzukunft2026@mastodon.socialN This user is from outside of this forum
                    naturzukunft2026@mastodon.social
                    wrote last edited by
                    #11

                    @evan Haha, it depends....
                    in changinggraph.org it is currently 20

                    1 Reply Last reply
                    0
                    • evan@cosocial.caE evan@cosocial.ca

                      #ActivityPub developers only please: how many items should be in a full collection page?

                      M This user is from outside of this forum
                      M This user is from outside of this forum
                      macgirvin@activitypub.space
                      wrote last edited by
                      #12

                      @evan@cosocial.ca As an opinion that is likely to be very unpopular... the page size ideally should be set by the client. Only they know their resource makeup and ability to process the returned information.

                      Otherwise, we tend to run page size between 60 and 100 depending on the content. And if it's less than 100 entries (and especially when returning an id-list rather than a list of activities), we'll usually just send them out without paging.

                      The desire is to balance resource usage to get the highest rate of information transfer, and those are the only levers we have available, and they (currently) aren't settable by clients, so it seems the best we can do is default to "large chunks".

                      I admit that I'm not fond of the page size of 12 that I found in Eugen's followers list of over half a million entries (some years ago). That's a lot of network requests and makes their clients work a lot harder than they need to.

                      1 Reply Last reply
                      1
                      0
                      • julian@activitypub.spaceJ This user is from outside of this forum
                        julian@activitypub.spaceJ This user is from outside of this forum
                        julian@activitypub.space
                        wrote last edited by
                        #13

                        @macgirvin I'm okay with that. I just wasn't really aware of any perPage style value that could be passed to servers.

                        1 Reply Last reply
                        1
                        0
                        • ? Offline
                          ? Offline
                          Guest
                          wrote last edited by
                          #14

                          @julian @macgirvin https://codeberg.org/silverpill/feps/src/branch/main/9f9f/fep-9f9f.md#pagination

                          django@social.coopD 1 Reply Last reply
                          0
                          • evan@cosocial.caE evan@cosocial.ca

                            #ActivityPub developers only please: how many items should be in a full collection page?

                            M This user is from outside of this forum
                            M This user is from outside of this forum
                            macgirvin@activitypub.space
                            wrote last edited by
                            #15

                            @silverpill@mitra.social -- Thanks. Don't know how I missed that, but I'll start using it right away. Cheers.

                            1 Reply Last reply
                            2
                            0
                            • ? Guest

                              @julian @macgirvin https://codeberg.org/silverpill/feps/src/branch/main/9f9f/fep-9f9f.md#pagination

                              django@social.coopD This user is from outside of this forum
                              django@social.coopD This user is from outside of this forum
                              django@social.coop
                              wrote last edited by
                              #16

                              @macgirvin @general @silverpill @julian that is a very useful thing for clients, thanks for that FEP!

                              1 Reply Last reply
                              0
                              • evan@cosocial.caE evan@cosocial.ca

                                #ActivityPub developers only please: how many items should be in a full collection page?

                                M This user is from outside of this forum
                                M This user is from outside of this forum
                                macgirvin@activitypub.space
                                wrote last edited by
                                #17

                                @silverpill@mitra.social @evan@cosocial.ca -- Now I see why I missed it. These additional properties aren't actually defined in the AS spec but only the FEP(?) immediately after implying that the pagination properties were all specified in the AS spec. I get it now, but maybe a wee bit of word-smithing in the FEP could make this a bit clearer.

                                I guess the question remains how to determine if a site offers cursor-based pagination or recognises 'maxItems' per FEP-9f9f. Guess you need to just try it, maybe with an odd number like 19, and see if what you get back is "consistent" with your request, to see if you should continue trying to use client defined pagination for this site. (This might be another good use case for the server 'capability' mechanism.)

                                1 Reply Last reply
                                1
                                0
                                • evan@cosocial.caE evan@cosocial.ca

                                  #ActivityPub developers only please: how many items should be in a full collection page?

                                  evan@cosocial.caE This user is from outside of this forum
                                  evan@cosocial.caE This user is from outside of this forum
                                  evan@cosocial.ca
                                  wrote last edited by
                                  #18

                                  So, here's the trade-off: adding embedded objects can reduce the number of extra HTTP requests required to render the page of objects. For example, if showing a `followers` collection, adding each actor's name, avatar, and so on can be a real savings.

                                  However, it puts a lot of costs on the server -- looking up cached or local data about each object.

                                  Long story short: adding embedded objects is a pressure towards having smaller page sizes.

                                  evan@cosocial.caE 1 Reply Last reply
                                  0
                                  • evan@cosocial.caE evan@cosocial.ca

                                    So, here's the trade-off: adding embedded objects can reduce the number of extra HTTP requests required to render the page of objects. For example, if showing a `followers` collection, adding each actor's name, avatar, and so on can be a real savings.

                                    However, it puts a lot of costs on the server -- looking up cached or local data about each object.

                                    Long story short: adding embedded objects is a pressure towards having smaller page sizes.

                                    evan@cosocial.caE This user is from outside of this forum
                                    evan@cosocial.caE This user is from outside of this forum
                                    evan@cosocial.ca
                                    wrote last edited by
                                    #19

                                    If you're not showing embedded objects, then filling up a collection page is usually just a couple of database queries. And adding more items to the page has very little extra cost.

                                    The bigger your pages are, the fewer requests a client has to make to get all the data.

                                    So, I think if you're not doing embedded objects, the pressure is towards bigger pages.

                                    evan@cosocial.caE 1 Reply Last reply
                                    0
                                    • evan@cosocial.caE evan@cosocial.ca

                                      If you're not showing embedded objects, then filling up a collection page is usually just a couple of database queries. And adding more items to the page has very little extra cost.

                                      The bigger your pages are, the fewer requests a client has to make to get all the data.

                                      So, I think if you're not doing embedded objects, the pressure is towards bigger pages.

                                      evan@cosocial.caE This user is from outside of this forum
                                      evan@cosocial.caE This user is from outside of this forum
                                      evan@cosocial.ca
                                      wrote last edited by
                                      #20

                                      There are a couple of other confounding factors.

                                      Adding embedded objects makes supporting HTTP Caching harder. The `ETag` header isn't too hard, but `Last-Modified` is difficult. You need to check not only what the collection page modification date is, but also each of the embedded objects (and take the max date!). It's a pain and most folks don't even implement it.

                                      evan@cosocial.caE 1 Reply Last reply
                                      0
                                      • evan@cosocial.caE evan@cosocial.ca

                                        There are a couple of other confounding factors.

                                        Adding embedded objects makes supporting HTTP Caching harder. The `ETag` header isn't too hard, but `Last-Modified` is difficult. You need to check not only what the collection page modification date is, but also each of the embedded objects (and take the max date!). It's a pain and most folks don't even implement it.

                                        evan@cosocial.caE This user is from outside of this forum
                                        evan@cosocial.caE This user is from outside of this forum
                                        evan@cosocial.ca
                                        wrote last edited by
                                        #21

                                        The other things is collection filtering. This is where you check each item in a page to see if the client can actually read it, and leaving it out if not. It's very important if you include embedded objects, and not that important if not. If you only include references, they can be checked when the client tries to fetch them.

                                        evan@cosocial.caE 1 Reply Last reply
                                        0
                                        • evan@cosocial.caE evan@cosocial.ca

                                          The other things is collection filtering. This is where you check each item in a page to see if the client can actually read it, and leaving it out if not. It's very important if you include embedded objects, and not that important if not. If you only include references, they can be checked when the client tries to fetch them.

                                          evan@cosocial.caE This user is from outside of this forum
                                          evan@cosocial.caE This user is from outside of this forum
                                          evan@cosocial.ca
                                          wrote last edited by
                                          #22

                                          Another thing is whether "pages" in your collection are real objects -- buckets that fill up with items as time goes on -- or just fixed-length offsets from the most recent item. I think having real pages is much better for caching and synchronization.

                                          evan@cosocial.caE 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups