What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

In a previous question regarding how auto drafts are saved, waffles indicated that the draft is sent to the server during the heartbeat.

That said, the questions are:

  • How often is the heartbeat sent?
  • What is sent to the server?
  • What is received from the server?

I've been able to gather the following:

What's missing?

share|improve this question
    
    
@NullUserExceptionஇ_இ: Fair enough, but isn't one of the points of Meta to have this information documented so not everyone has to ascertain it for themselves (and get it wrong or miss something)? And I use Chrome, not Firefox (but I can use Fiddler). =) –  casperOne Nov 9 '11 at 20:47

2 Answers 2

up vote 18 down vote accepted

In the usual case (meaning you're using only one editor and not several, e.g. because you're answering a question while also editing it and another answer etc.) -- the heartbeat happens every 45 seconds.

It sends the following:

  • Whether you're writing a question, an answer, or are editing a post
  • When answering, it sends the Id of the question you're answering. When editing, it sends the Id of the post that's being edited.
  • When answering, it sends information about what other answers the client (i.e. your browser) already knows about (see below)
  • If you're asking or answering, and you have changed something since the previous heartbeat, it sends the full text of the post (and, if applicable, title and tags)

The server saves the draft, and returns the following to the client:

  • When asking, it returns a list of "similar questions" that's shown in the sidebar
  • When answering, it checks whether the question has been deleted, locked, or closed in the meantime (you have certainly seen the "this post has been closed; no more answers will be accepted" message before – this is where it comes from)
  • When answering, it checks whether there are answers that the client doesn't know about yet (see above), so you get the "2 new answers have been posted" message
  • When editing, it checks whether the post has been locked or deleted, or has been edited in the meantime ("This post has been edited 1 time since you began").

Random trivia: The heartbeat is controlled by an object called StackExchange.cardiologist.

share|improve this answer
7  
Thanks for very detailed answer! I assume you call the error handler "HeartAttack"? ;) –  Shadow Wizard Nov 10 '11 at 9:53
2  
@balpha: StackExchange.cardiologist is a pretty GDLK name. –  casperOne Nov 10 '11 at 12:20

The heartbeat is sent about once a minute, according to the very question you linked to.

share|improve this answer

You must log in to answer this question.

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