Answers.Body: <p>I use this to force the task icon to show up immediately:</p>
  
  <pre><code>Craft.cp.setRunningTaskInfo({
      "id": "task ID",
      "level": "0",
      "description": "description",
      "status": "running",
      "progress": 0
  });
  Craft.cp.trackTaskProgress();
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-21T14:40:02.177Z
Answers.LastActivityDate: 2015-06-21T14:40:02.177Z
Answers.UserDisplayName: Bob Olde Hampsink
Body: <p>I have a plugin that starts a task and subtasks from a CP widget AJAX call. The tasks are running without a hitch, but for some reason on production, the icon does not appear when the tasks start running unless I refresh the page. </p>
  
  <p>On my local dev site (MAMP), the task icon appears as soon as the code below is called.</p>
  
  <p>I am using this code to start the pending tasks I created:</p>
  
  <pre><code>Craft.cp.runPendingTasks();
  </code></pre>
  
  <p>Any ideas? Is there a different JS command I should be using?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-11T22:17:36.507Z
Comments.Text: I've seen that on some setups with gzip compression enabled (either at the Apache level or at the PHP level). Might be worth checking.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-12T20:53:12.710Z
Comments.Text: Yup, it looks like that is the case. Any thoughts on getting around it? It isn't imperative that the circle displays, but the visual feedback is nice.
Comments.UserDisplayName: Aaron Berkowitz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-12T20:55:53.120Z
Comments.Text: We've spent a ton of time looking into it and it comes down to the fact that PHP sucks. Workaround is to set http://buildwithcraft.com/docs/config-settings#runTasksAutomatically to false and setup an external cron job to trigger tasks.
Comments.UserDisplayName: Brad Bell
Tags: <plugin-development><control-panel><javascript><tasks>
Title: Trigger Task Status Icon
ThreadText: # Trigger Task Status Icon
  
  (Asked by: username_0 on 2015-03-11)
  
  I have a plugin that starts a task and subtasks from a CP widget AJAX call. The tasks are running without a hitch, but for some reason on production, the icon does not appear when the tasks start running unless I refresh the page.
  
  On my local dev site (MAMP), the task icon appears as soon as the code below is called.
  
  I am using this code to start the pending tasks I created:
  
  ```
  Craft.cp.runPendingTasks();
  
  ```
  
  Any ideas? Is there a different JS command I should be using?
  
  **Tags:** plugin-development, control-panel, javascript, tasks
  
  > **Comments:**
  > **username_1**: I've seen that on some setups with gzip compression enabled (either at the Apache level or at the PHP level). Might be worth checking.  
  > **username_0**: Yup, it looks like that is the case. Any thoughts on getting around it? It isn't imperative that the circle displays, but the visual feedback is nice.  
  > **username_1**: We've spent a ton of time looking into it and it comes down to the fact that PHP sucks. Workaround is to set http://buildwithcraft.com/docs/config-settings#runTasksAutomatically to false and setup an external cron job to trigger tasks.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-06-21. Score: 6
  
  I use this to force the task icon to show up immediately:
  
  ```
  Craft.cp.setRunningTaskInfo({
      "id": "task ID",
      "level": "0",
      "description": "description",
      "status": "running",
      "progress": 0
  });
  Craft.cp.trackTaskProgress();
  
  ```
  
  
  ---
  
  