Skip to content
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
  • 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
Brand Logo

fedi wiki

  1. Home
  2. Technical Discussion
  3. Our X-RateLimit-Reset headers are bad and we should feel bad

Our X-RateLimit-Reset headers are bad and we should feel bad

Scheduled Pinned Locked Moved Technical Discussion
4 Posts 3 Posters 7 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@activitypub.spaceE This user is from outside of this forum
    evan@activitypub.spaceE This user is from outside of this forum
    evan@activitypub.space
    wrote last edited by
    #1

    I've found at least four different formats used on the Fediverse for the X-RateLimit-Reset header:

    • A datestamp (Mastodon)
    • Unix epoch in seconds
    • Time offset in seconds (N seconds from now)
    • Unix epoch in milliseconds (Holos)

    It's possible to use some heuristics for these (looks like a date, looks like an integer, range of the integer), which are pretty reliable.

    The new RateLimit headers from IETF are very nice, but don't seem to be well-supported yet.

    evan@activitypub.spaceE ryan@m29.usR 2 Replies Last reply
    0
    • evan@activitypub.spaceE evan@activitypub.space

      I've found at least four different formats used on the Fediverse for the X-RateLimit-Reset header:

      • A datestamp (Mastodon)
      • Unix epoch in seconds
      • Time offset in seconds (N seconds from now)
      • Unix epoch in milliseconds (Holos)

      It's possible to use some heuristics for these (looks like a date, looks like an integer, range of the integer), which are pretty reliable.

      The new RateLimit headers from IETF are very nice, but don't seem to be well-supported yet.

      evan@activitypub.spaceE This user is from outside of this forum
      evan@activitypub.spaceE This user is from outside of this forum
      evan@activitypub.space
      wrote last edited by
      #2

      Of course, you can just bang on the API until you get 429 restricted, too.

      julian@activitypub.spaceJ 1 Reply Last reply
      0
      • evan@activitypub.spaceE evan@activitypub.space

        I've found at least four different formats used on the Fediverse for the X-RateLimit-Reset header:

        • A datestamp (Mastodon)
        • Unix epoch in seconds
        • Time offset in seconds (N seconds from now)
        • Unix epoch in milliseconds (Holos)

        It's possible to use some heuristics for these (looks like a date, looks like an integer, range of the integer), which are pretty reliable.

        The new RateLimit headers from IETF are very nice, but don't seem to be well-supported yet.

        ryan@m29.usR This user is from outside of this forum
        ryan@m29.usR This user is from outside of this forum
        ryan@m29.us
        wrote last edited by
        #3

        @evan I have a Python function I've built up over time for handling rate limiting headers (no canonical location for it; I just copy it around when needed). I've come across epoch (GitHub) and ISO 8601 (Mastodon, Jira), but haven't seen the other two. I'll take a look at the RateLimit spec, thanks.

        https://forge.colobox.com/rfinnie/rf-tools/src/branch/main/bin/mastodon-downloader#L50

        (For the last few weeks I've been working on moving stuff to Forgejo, and I'm surprised their API doesn't have rate limit headers.)

        1 Reply Last reply
        0
        • evan@activitypub.spaceE evan@activitypub.space

          Of course, you can just bang on the API until you get 429 restricted, too.

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

          @evan 429? Amateur hour.

          You need to keep banging on the API until the server is overwhelmed and times out. That's the 2026 way.

          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