title: CAUTION: provisional header are shown
body: <p>I cant debug this message which appeared like a week ago.</p>
  
  <p>I tried restoring to old files but this is odd, nothing solves my problem.</p>
  
  <p>So: I have two long polling requests. (turning one of them off does not help).</p>
  
  <p>for example this is one of them:</p>
  
  <pre><code>public function update_private_messages_ajax_handler(){
      global $wpdb;
      global $bp;
      $chat_table = $wpdb-&gt;prefix . 'bp_dollars_chat';
  
      $current_user = $bp-&gt;loggedin_user-&gt;id;
  
      ob_start();
      header("Content-Type: application/json");
      header("Cache-Control: no-cache, must-revalidate");
      header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
  
      $startTime = time();
      while((time()-$startTime)&lt;=20) {
          $messages = $wpdb-&gt;get_results(
              $wpdb-&gt;prepare("(SELECT * 
                  FROM $chat_table 
                  WHERE to_user = %d
                  AND recd = 1
                  AND id &gt; %d
                  ORDER BY id DESC) ORDER BY id ASC
              ", $current_user, $_POST['last_id'])
          );
          if($messages) {
              foreach($messages as $v){
                  //$v-&gt;timestring = date_i18n($this-&gt;date_format.' - '.$this-&gt;time_format, $v-&gt;unix_timestamp+$this-&gt;gmt_offset);
                  $v-&gt;name = get_dollar_name($v-&gt;from_user);
                  $v-&gt;avatar = get_avatar($v-&gt;from_user, 50);
                  //$v-&gt;message = convert_smilies( $v-&gt;message );
              }
              $response = json_encode(array('no_participation' =&gt; $this-&gt;no_participation, 'success'=&gt; 1, 'messages'=&gt;$messages));
  
              echo $response;
              ob_flush(); flush();
              exit;
          } else {
              sleep($this-&gt;options['timeout_refresh_messages']);
          }
      }
  
      $response = json_encode(array('no_participation' =&gt; $this-&gt;no_participation, 'success'=&gt; 0));
  
      echo $response;
      ob_flush(); flush();
      exit;
  }
  </code></pre>
  
  <p>As you can see, I sent cache-control headers, so this should not be problem <a href="https://stackoverflow.com/questions/21177387/caution-provisional-headers-are-shown-in-chrome-debugger">described here</a>
  I also dont have any adBlocker installed and this is local installation.</p>
  
  <p>there is a client-side script</p>
  
  <pre><code>update_private_messages: function() {
      jQuery.post(quick_chat.ajaxurl, {
              action: 'quick-chat-ajax-update-pmessages',
              last_id: quick_chat.last_private_id
          },
          function(data) {
              console.log(data);
              if(data.success == 1) {
                  var updates = data.messages;
                  var already_notified = 0;
                  var chat_history = jQuery('.popoverx.chat.in .chathistory');
                  for(var i=0;typeof(updates[i])!='undefined';i++){
                      // this in case if window open and new message is for current user
                      if(quick_chat.privateOpen == true &amp;&amp; (quick_chat.privateOhter == updates[i].from_user || quick_chat.privateOhter == updates[i].to_user )) {
                          // @TODO do I animate every time?
                          jQuery(chat_history).prepend(quick_chat.single_private_html(updates[i])).animate({scrollTop: 0}, 500);
                      } else if(updates[i].recd == 1 &amp;&amp; updates[i].from_user != quick_chat.user_id) {
                          // not yet in unread group
                          if(quick_chat.privateUnread.indexOf(parseInt(updates[i].from_user)) == -1) {
                              quick_chat.privateUnread.push(parseInt(updates[i].from_user));
                          }
                          if(already_notified == 0 &amp;&amp; quick_chat.last_private_id != 0 &amp;&amp; updates[i].from_user != quick_chat.user_id) {
                              if(quick_chat.play_audio == 1) {
                                  quick_chat.audio_element.play();
                              }
                              already_notified = 1;
                          }
                      }
                  }
                  // update label
                  var unreadIcon = jQuery('#bs-navbar-right &gt; li &gt; a.messages');
                  if(quick_chat.privateUnread.length != 0) {
                      unreadIcon.find('span').remove().end().append('&lt;span class="label label-danger"&gt;'+ quick_chat.privateUnread.length +'&lt;/span&gt;')
                  } else {
                      unreadIcon.find('span').remove()
                  }
                  quick_chat.last_private_id = updates[updates.length-1].id;
              }
              quick_chat.update_private_messages();
          }, 'json'
      );
  }
  </code></pre>
  
  <p>Is this normal? I cant be normal message for long polling - since its a pending request.
  Its just does not seem to be documented anywhere</p>
  
  <hr>
  
  <p>Note:
  also I have many short-polling requests and this could be case where more then 6 requests cancel each other but - I also tried turning all other requests off, except one (long polling) and this is not a case</p>
  
  <hr>
  
  <p>Here is a original script working so you can see the message:
  <a href="http://www.techytalk.info/wordpress/quick-chat/" rel="nofollow noreferrer">http://www.techytalk.info/wordpress/quick-chat/</a></p>
  
  <hr>
  
  <p>Just to summirize this question: Is this normal? (I don't see this problem on other sites where comet is used) - and if not - Where should I seek for problem, clientside or server-side? <a href="https://stackoverflow.com/questions/21177387/caution-provisional-headers-are-shown-in-chrome-debugger">Here</a> they say that in such case request is not sent at all, but thats not true, my scripts are working and I cant chat (this is a chat script)</p>