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: do you implement rate limit support in your HTTP client implementation?

#ActivityPub developers only: do you implement rate limit support in your HTTP client implementation?

Scheduled Pinned Locked Moved Uncategorized
activitypubevanpollpoll
1 Cross-posts 28 Posts 5 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.
  • smallcircles@social.coopS smallcircles@social.coop

    @evan @julian

    For OAuth it is also questionable the extent to which its use should be dictated. For instance in CloudEvents "modeling the security layer" is only facilitated by the protocol spec, another extensibility point.

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

    @smallcircles @julian I think we might have different ideas about what the ActivityPub API task force is for.

    To me, it's about making it possible for clients to use different servers, and different implementations of the API. That's going to include the social API defined in the ActivityPub standard, but it will also encompass things like rate limits, authentication, caching, CORS, and so on.

    How that all gets documented will probably be in one or more community group reports.

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

      @smallcircles @julian I think we might have different ideas about what the ActivityPub API task force is for.

      To me, it's about making it possible for clients to use different servers, and different implementations of the API. That's going to include the social API defined in the ActivityPub standard, but it will also encompass things like rate limits, authentication, caching, CORS, and so on.

      How that all gets documented will probably be in one or more community group reports.

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

      @evan @julian

      The extent to which the default profile becomes a 'straightjacket' impact scope, applicability, and usability. I guess its alright as long as there's sufficient flexibility and extensibility taken into account. Guess the "sufficient" does the heavy lifting here.

      evan@cosocial.caE 1 Reply Last reply
      1
      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
        #18

        @julian There are 3 main clusters.

        They're linked here for the ActivityPub API task force, but they also apply for the federation protocol:

        Link Preview Image
        Rate limiting · Issue #4 · swicg/activitypub-api

        "As an ActivityPub client developer, I want a reliable and standard way to discover rate limits in an ActivityPub API server, so I can avoid unexpected failures for my users."

        favicon

        GitHub (github.com)

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

          @julian There are 3 main clusters.

          They're linked here for the ActivityPub API task force, but they also apply for the federation protocol:

          Link Preview Image
          Rate limiting · Issue #4 · swicg/activitypub-api

          "As an ActivityPub client developer, I want a reliable and standard way to discover rate limits in an ActivityPub API server, so I can avoid unexpected failures for my users."

          favicon

          GitHub (github.com)

          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

          @julian The first is the most standard, `Retry-After`. You get it mostly on `429 Too Many Requests` responses, as a way to tell you when you're next allowed to make a request. Unfortunately, by the time you get it, you're already in the penalty box. It's better to get information on the request quota *before* you get locked out, so you can throttle your requests and avoid getting locked out.

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

            @julian The first is the most standard, `Retry-After`. You get it mostly on `429 Too Many Requests` responses, as a way to tell you when you're next allowed to make a request. Unfortunately, by the time you get it, you're already in the penalty box. It's better to get information on the request quota *before* you get locked out, so you can throttle your requests and avoid getting locked out.

            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

            @julian The second cluster is a de facto standard used for a lot of APIs, with a lot of incompatible variations. The most common pattern is:

            X-RateLimit-Remaining: integer, how many requests left in your quota
            X-RateLimit-Reset: timestamp, when your quota will reset to full

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

              @julian The second cluster is a de facto standard used for a lot of APIs, with a lot of incompatible variations. The most common pattern is:

              X-RateLimit-Remaining: integer, how many requests left in your quota
              X-RateLimit-Reset: timestamp, when your quota will reset to full

              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

              @julian

              So, if the rate limit is 300 requests every 5 minutes, and you've already used 143 requests, you might see headers like this:

              X-RateLimit-Remaining: 157
              X-RateLimit-Reset: 2026-03-22T22:10:00Z

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

                @julian

                So, if the rate limit is 300 requests every 5 minutes, and you've already used 143 requests, you might see headers like this:

                X-RateLimit-Remaining: 157
                X-RateLimit-Reset: 2026-03-22T22:10:00Z

                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

                @julian Unfortunately, there are a ton of conflicting variations on this pattern. Some APIs use a Unix timestamp for the reset datetime (!), others use HTTP header values. Mastodon uses an ISO 8601 datetime.

                The X-RateLimit-* headers also don't work well if there are multiple quota policies. That can happen if there are particular types of requests that are under a stricter quota than others. There are some variants that APIs use, but they're specific to the platform.

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

                  @julian Unfortunately, there are a ton of conflicting variations on this pattern. Some APIs use a Unix timestamp for the reset datetime (!), others use HTTP header values. Mastodon uses an ISO 8601 datetime.

                  The X-RateLimit-* headers also don't work well if there are multiple quota policies. That can happen if there are particular types of requests that are under a stricter quota than others. There are some variants that APIs use, but they're specific to the platform.

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

                  @julian The big advance is the new rate limit headers RFC draft:

                  Link Preview Image
                  RateLimit header fields for HTTP

                  RateLimit header fields for HTTP (Internet-Draft, 2025)

                  favicon

                  IETF Datatracker (datatracker.ietf.org)

                  It supports having multiple policies. It's very clean and elegant. Unfortunately, it's still in draft stage. It's probably good to be ready for future changes if you're going to implement this.

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

                    @evan @julian

                    The extent to which the default profile becomes a 'straightjacket' impact scope, applicability, and usability. I guess its alright as long as there's sufficient flexibility and extensibility taken into account. Guess the "sufficient" does the heavy lifting here.

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

                    @smallcircles @julian I think that's always a tension in standards! How do you make it explicit enough that developers can build interoperable software, but extensible enough that they can try new things?

                    I think one pattern that works well is some base-level standards assumed, and easy ways for extensions to be discoverable and negotiable. If your preferred extension isn't available from the software on the other side of the line, you fall back to the base-level standard.

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

                      @smallcircles @julian I think that's always a tension in standards! How do you make it explicit enough that developers can build interoperable software, but extensible enough that they can try new things?

                      I think one pattern that works well is some base-level standards assumed, and easy ways for extensions to be discoverable and negotiable. If your preferred extension isn't available from the software on the other side of the line, you fall back to the base-level standard.

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

                      @smallcircles @julian I'd suggest streaming data as an example of a good extension. If it's not available, the client can resort to periodically polling instead.

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

                        #ActivityPub developers only: do you implement rate limit support in your HTTP client implementation?

                        #EvanPoll #poll

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

                        Thanks to everyone who responded. My answer is yes; I've had to add HTTP client throttling support in tags.pub. I'm going to add rate limit checking on the server side, too. It's worth it to be explicit.

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

                          @smallcircles @julian I'd suggest streaming data as an example of a good extension. If it's not available, the client can resort to periodically polling instead.

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

                          @evan @julian

                          I have created a separate issue "Protocol design" in the #ActivityPub API repo, cross-referencing to this discussion and the issue I created earlier to "Avoid misconception".

                          Link Preview Image
                          Protocol design · Issue #66 · swicg/activitypub-api

                          (This issue is created in follow-up of #63 Avoid misconception and #4 Rate limiting, and related fedi thread.) Avoiding misconceptions: What is a profile? I think my overarching concern is that the ActivityPub API specification doesn't b...

                          favicon

                          GitHub (github.com)

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

                            @evan @julian

                            I have created a separate issue "Protocol design" in the #ActivityPub API repo, cross-referencing to this discussion and the issue I created earlier to "Avoid misconception".

                            Link Preview Image
                            Protocol design · Issue #66 · swicg/activitypub-api

                            (This issue is created in follow-up of #63 Avoid misconception and #4 Rate limiting, and related fedi thread.) Avoiding misconceptions: What is a profile? I think my overarching concern is that the ActivityPub API specification doesn't b...

                            favicon

                            GitHub (github.com)

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

                            @smallcircles @julian

                            Great, thanks.

                            1 Reply Last reply
                            1
                            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