title: Very slow ajax response on yii framework
body: <p>i am having strange issue with yii framework. on localhost, ajax response takes 200ms (which is fast and i am satsified) where as on my live server, same function take 4 to 7 seconds.</p>
  
  <p><strong>below is my php ajax function:-</strong></p>
  
  <pre><code>public function actionOpenpopup() {
                      $this-&gt;checkAjaxRequest();                  
  
                      $user_id = $_GET['uid'];
  
                      $rows = Yii::app()-&gt;db-&gt;createCommand()
                                -&gt;select('*')
                                -&gt;from('saved_designs')
                                -&gt;where('uid=:id', array(':id' =&gt; $user_id))
                                -&gt;order('date desc')
                                -&gt;queryAll();
  
                      $i = 0;
                      foreach ($rows as $row) {
                                $rows[$i] = $row;
                                $i++;
                      }
                      if ($rows) {
                                echo json_encode($rows);
                      }
                      else
                                echo json_encode(null);
            }
  
  
  
   function checkAjaxRequest() {
                          if (Yii::app()-&gt;request-&gt;isAjaxRequest) {
                                    header('Content-Type: application/json; charset="UTF-8"');
                                    return true;
                          } else {
                                    throw new CHttpException('403', 'Forbidden Access');
                                    exit;
                          }
                }
  </code></pre>
  
  <p><strong>javascript code is:-</strong></p>
  
  <pre><code>function sendAjaxCall(data){
  
  $.ajax({
                                  type : 'GET',
                                  url : 'index.php/request/openpopup',
                                  datatype : 'json',
                                  data :data,
                   success: function (data) {
                          console.log(data);                      
                          }
  });    
  
  }
  </code></pre>
  
  <p>*<strong><em>Note:- So far database has only 10 to 20 records. Also On live server, all my ajax calls give me slow response.</em></strong>  </p>