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 (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. Technical Discussion
  3. Stable Outbox Collection Pages

Stable Outbox Collection Pages

Scheduled Pinned Locked Moved Technical Discussion
activitypubactivitystreamsfedidev
1 Cross-posts 11 Posts 3 Posters 1 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.
  • reiver@mastodon.socialR This user is from outside of this forum
    reiver@mastodon.socialR This user is from outside of this forum
    reiver@mastodon.social
    wrote last edited by
    #1

    Stable Outbox Collection Pages

    1/

    ActivityPub uses collections for a number of things:

    • followers
    • following
    • inbox
    • outbox

    And, rather than dump everything in the collection into a single document, ActivityPub paginates using collection pages.

    That's great.

    But, how you divide up a collection into pages matters and affects things. Such as: caching.

    I'll explain.

    #ActivityPub #ActivityStreams #FediDev

    reiver@mastodon.socialR 1 Reply Last reply
    0
    • reiver@mastodon.socialR reiver@mastodon.social

      Stable Outbox Collection Pages

      1/

      ActivityPub uses collections for a number of things:

      • followers
      • following
      • inbox
      • outbox

      And, rather than dump everything in the collection into a single document, ActivityPub paginates using collection pages.

      That's great.

      But, how you divide up a collection into pages matters and affects things. Such as: caching.

      I'll explain.

      #ActivityPub #ActivityStreams #FediDev

      reiver@mastodon.socialR This user is from outside of this forum
      reiver@mastodon.socialR This user is from outside of this forum
      reiver@mastodon.social
      wrote last edited by
      #2

      Stable Outbox Collection Pages

      2/

      Let's say a collection has 23 items, and each page 10 items in length.

      That means you will have 2 pages with 10 items and 1 page with 3 items.

      Should that page with 3 items be the 3 newest items or the 3 oldest items.

      The choice affects caching and static site ease quite a bit.

      Here is the answer...

      #ActivityPub #ActivityStreams #FediDev

      reiver@mastodon.socialR 1 Reply Last reply
      0
      • reiver@mastodon.socialR reiver@mastodon.social

        Stable Outbox Collection Pages

        2/

        Let's say a collection has 23 items, and each page 10 items in length.

        That means you will have 2 pages with 10 items and 1 page with 3 items.

        Should that page with 3 items be the 3 newest items or the 3 oldest items.

        The choice affects caching and static site ease quite a bit.

        Here is the answer...

        #ActivityPub #ActivityStreams #FediDev

        reiver@mastodon.socialR This user is from outside of this forum
        reiver@mastodon.socialR This user is from outside of this forum
        reiver@mastodon.social
        wrote last edited by
        #3

        Stable Outbox Collection Pages

        3/

        If the page with 3 items contains the 3 oldest items, then —

        Every time a new items is added to the collection, then every single collection page will change. I.e., they all churn.

        Which means that all cached copies of any collection pages will be invalidated.

        Which means a static site generator will have to regenerate all of them again.

        Etc.

        BUT, if instead —

        #ActivityPub #ActivityStreams #FediDev

        reiver@mastodon.socialR 1 Reply Last reply
        0
        • reiver@mastodon.socialR reiver@mastodon.social

          Stable Outbox Collection Pages

          3/

          If the page with 3 items contains the 3 oldest items, then —

          Every time a new items is added to the collection, then every single collection page will change. I.e., they all churn.

          Which means that all cached copies of any collection pages will be invalidated.

          Which means a static site generator will have to regenerate all of them again.

          Etc.

          BUT, if instead —

          #ActivityPub #ActivityStreams #FediDev

          reiver@mastodon.socialR This user is from outside of this forum
          reiver@mastodon.socialR This user is from outside of this forum
          reiver@mastodon.social
          wrote last edited by
          #4

          Stable Outbox Collection Pages

          4/

          BUT, if instead — if the page with 3 items contains the 3 newest items, then —

          Only the newest page would have to be recached. I.e., only 1 page churns not all.

          All the other collection pages stay as is, and any cached copies of them as still valid.

          Etc.

          #ActivityPub #ActivityStreams #FediDev

          reiver@mastodon.socialR 1 Reply Last reply
          0
          • reiver@mastodon.socialR reiver@mastodon.social

            Stable Outbox Collection Pages

            4/

            BUT, if instead — if the page with 3 items contains the 3 newest items, then —

            Only the newest page would have to be recached. I.e., only 1 page churns not all.

            All the other collection pages stay as is, and any cached copies of them as still valid.

            Etc.

            #ActivityPub #ActivityStreams #FediDev

            reiver@mastodon.socialR This user is from outside of this forum
            reiver@mastodon.socialR This user is from outside of this forum
            reiver@mastodon.social
            wrote last edited by
            #5

            Stable Outbox Collection Pages

            5/

            To me,, having the newest page of the collection be varying length one feel like a better strategy.

            #ActivityPub #ActivityStreams #FediDev

            evan@cosocial.caE steve@social.technoetic.comS 2 Replies Last reply
            0
            • reiver@mastodon.socialR reiver@mastodon.social

              Stable Outbox Collection Pages

              5/

              To me,, having the newest page of the collection be varying length one feel like a better strategy.

              #ActivityPub #ActivityStreams #FediDev

              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

              @reiver I agree

              evan@cosocial.caE 1 Reply Last reply
              0
              • ? Guest crossposted this topic to General Discussion
              • evan@cosocial.caE evan@cosocial.ca

                @reiver I agree

                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
                #7

                @reiver I think there's a good trick where if your page size is N then your first page is always less than 2N, it's the volatile one, and when it gets to 2N you move N many to a next page and link it in. So your first page always has enough items.

                Also, I think having static page objects, rather than offsets or fencepost items, is best for caching and traversal.

                1 Reply Last reply
                0
                • reiver@mastodon.socialR reiver@mastodon.social

                  Stable Outbox Collection Pages

                  5/

                  To me,, having the newest page of the collection be varying length one feel like a better strategy.

                  #ActivityPub #ActivityStreams #FediDev

                  steve@social.technoetic.comS This user is from outside of this forum
                  steve@social.technoetic.comS This user is from outside of this forum
                  steve@social.technoetic.com
                  wrote last edited by
                  #8

                  @reiver With static/stable collection pages, how do you handle HTTP authorization (which disables HTTP shared caching by default)? For example, an outbox might have a combination of public and non-public activities so different users will see different pages and/or page contents. Also, one might not want to return Create and Updates activities for content that has been deleted (which could affect older static pages).

                  reiver@mastodon.socialR 1 Reply Last reply
                  0
                  • steve@social.technoetic.comS steve@social.technoetic.com

                    @reiver With static/stable collection pages, how do you handle HTTP authorization (which disables HTTP shared caching by default)? For example, an outbox might have a combination of public and non-public activities so different users will see different pages and/or page contents. Also, one might not want to return Create and Updates activities for content that has been deleted (which could affect older static pages).

                    reiver@mastodon.socialR This user is from outside of this forum
                    reiver@mastodon.socialR This user is from outside of this forum
                    reiver@mastodon.social
                    wrote last edited by
                    #9

                    @steve

                    I didn't talk about the following in this thread, because I was trying to keep its scope limited, but —

                    I think some of those things could be more easily addressed if value of the "orderedItems" or "items" was just a list of URLs each pointing to a document containing the activity.

                    ...

                    reiver@mastodon.socialR 1 Reply Last reply
                    0
                    • reiver@mastodon.socialR reiver@mastodon.social

                      @steve

                      I didn't talk about the following in this thread, because I was trying to keep its scope limited, but —

                      I think some of those things could be more easily addressed if value of the "orderedItems" or "items" was just a list of URLs each pointing to a document containing the activity.

                      ...

                      reiver@mastodon.socialR This user is from outside of this forum
                      reiver@mastodon.socialR This user is from outside of this forum
                      reiver@mastodon.social
                      wrote last edited by
                      #10

                      @steve

                      So, one technique could be that a server lists activity URLs for everything. Including information that requires HTTP authorization.

                      And the server would return a 401 or 403 for activities that the user is not auth'ed to view.

                      ...

                      Alternatively, an auth'ed user could be redirected to another collection with other collection pages.

                      ...

                      reiver@mastodon.socialR 1 Reply Last reply
                      0
                      • reiver@mastodon.socialR reiver@mastodon.social

                        @steve

                        So, one technique could be that a server lists activity URLs for everything. Including information that requires HTTP authorization.

                        And the server would return a 401 or 403 for activities that the user is not auth'ed to view.

                        ...

                        Alternatively, an auth'ed user could be redirected to another collection with other collection pages.

                        ...

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

                        @steve

                        Regarding Create and Updates activities for content that has been deleted —

                        ...

                        These could always be turned into Tombstones.

                        Which is easier to do with separate activity documents being pointed to from the outbox.

                        ...

                        But, if the software wants to completely purge this data, then that would force a cache invalidation potentially across many collection pages.

                        1 Reply Last reply
                        0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

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