Skip to content

Being rate limited breaks the website #3340

Description

@ff137

Current Behavior
When I'm rate limited due to my app making requests, then it breaks the OpenDota website experience. Nothing loads on the main pages, so it looks like site is down, but trying to load a match page shows a banner with "Whoops! Something went wrong. (429)" -- so that's the only way I realised it's rate limiting and not something else.

Expected behavior/code
Ideally, the main website should still display pages when a user's IP is rate-limited from their API usage.
This can be achieved by website-usage being rate limited separately, or other options: manually add api key to query param of website link (currently doesn't work that way), or opt-in to automatically use api key when rate limited on the API Keys page.

Console Output
E.g. on matches page nothing is displayed, and 2 GET requests in console logs show 429:
Image

Environment

Not applicable.

Possible Solution

Allow adding ?api_key to website link, and use that key for page's API requests, so there is a manual fallback option. Might be a fine approach, because it's a very niche problem ... there's not a lot users running an app that uses up their free API usage every day. The pages could then just handle a 429 to display to the user that's why it's failing, and point them to appending ?api_key to fix it.

Alternative is that API usage routed through the website should be rate limited separately, so it should almost never happen that 429 breaks website experience, but that's maybe too much effort for a niche problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions