9

Many of features of Stack Overflow are rate limited either to restrict spam bots and inexperienced users (posting questions and answers) or to reduce impact of heavy queries. Why is loading the close/flag dialog limited to once every 3 seconds rate-limited?

It has no impact in terms of what other users see, and it doesn't seem like it should be an expensive query. Is here something about permissions that makes it expensive or is it limited for some other reason?

  • There's another reason for rate limiting, and that's to stop you from doing stuff too quickly. I close quite a few questions every day, and I have never hit that particular limit, perhaps you should start considering slowing your pace a bit? – yannis Mar 20 '13 at 17:07
  • 1
    @Yannis It was accidentally closing the dialog then reopening it that triggered it. – user1937198 Mar 20 '13 at 17:09
  • @yannis so this is a sort of general flagging/closing rate-limit – user1937198 Mar 20 '13 at 17:11
  • 1
    I'm not 100% sure (which is why I posted a comment instead of an answer ;), the limit is mentioned in the FAQ question about rate limits, but with no explanation. – yannis Mar 20 '13 at 17:17
  • @Yannis It doesn't mention anything about rate-limiting flags or closing so it looks likely. – user1937198 Mar 20 '13 at 17:22
  • 3
    This rate limiting should be disabled for moderators. It's ridiculous how much I hit this in the flag queue (and it's because I'm using a combination of keyboard commands and mouse button clicks). – casperOne Mar 20 '13 at 17:46
  • I ran into it earlier today as well, though by accident. Definitely made me curious as to why this happens. – Nightfirecat Apr 12 '13 at 2:10
2

I asked the same question a while ago on Meta Stack Overflow, and the answer I got is because the flag and close dialogs need to get a lot of information from the server, here are some examples:

  • How many close votes/flags the user has cast that day, to know if they are allowed to cast any more and if yes how many.
  • If you have already flagged/voted to close that post recently, because if that is the case you're not allowed to do it again.
  • If the post is deleted, to know what flags should be available (only the "in need of moderator intervention" flag is available on deleted posts) or if you should be allowed to close it (you can't vote to close deleted questions).
  • How old the post is, to know if it's too old to be migrated.
  • (flag dialog only) If the post is closed, to know if the "should be closed" flag should be available.
  • (flag dialog only) If the post has a negative score, to know if the "very low quality" flag should be available.
  • (close dialog only) How many users have voted to close the question, to display these numbers.

There may be even more information that the dialogs need. My point is that if someone programs a bot to load the dialogs every millisecond or something, all the above information will need to be downloaded from the server each time the bot opens the dialog, which would be enough to make the site stop working. So the reason to rate limit opening the close/flag dialog is to prevent bots from overloading the server by loading the dialog too often.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .