title: signalR client function not being called when going through a CDN
body: <p>I have the following JS code </p>
  
  <pre><code>var chat = $.connection.MyHub;
  chat.client.initChart = function (data) { 
      ... do stuff ...
  }
  </code></pre>
  
  <p>and this hub code</p>
  
  <pre><code>public class MyHub : Hub
  {
      public override Task OnConnected()
      {
          using (var conn = new SqlConnection(ConnectionString))
          {
              conn.Open();
  
              //Using Dapper
              var data = conn.Query("SELECT data FROM Sql").ToList();
  
  
              return Clients.Caller.initChart(data);
          }
      }
  
  }
  </code></pre>
  
  <p>this works perfectly on my machine (Win7Pro, IIS 7), however, when I deploy it to our server (Win2008R2, iis7) it doesn't call the <code>initChart</code> function.  I've got VS installed on the server, and when I debug the process, the <code>OnConnected</code> event is called and completes successfully, but nothing happens on the client.  There are no JS errors or server side errors occurring that I can see.</p>
  
  <p>Just to confuse things further, I have another function declared on the client that is called by an NServiceBus handler, this function gets called every time, I put a browser breakpoint in there &amp; I can see it being called.</p>
  
  <p>Checking the signalR logs on my machine it uses SSE, but on the server it falls back to long polling.</p>
  
  <p>UPDATE: Just realized the server is sitting behind Akamai's DSD, if I don't go through this, it works, but I can't see why it makes a difference.</p>
  
  <p>2nd Update:</p>
  
  <p>Here are the different response headers for the <code>connect?transport=serverSentEvents&amp;connectionId=9fce5552-4c2e-4739-93ea-501dda0a0654&amp;connectionData=%5B%7B%22name%22%3A%22navigationtiminghub%22%7D%5D&amp;tid=9 HTTP/1.1</code> call</p>
  
  <p>first, the request when I call directly to origin:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Cache-Control: no-cache
  Pragma: no-cache
  Transfer-Encoding: chunked
  Content-Type: text/event-stream
  Expires: -1
  Server: Microsoft-IIS/7.5
  Date: Mon, 07 Jan 2013 01:08:26 GMT
  </code></pre>
  
  <p>and this is Akamai's response. Note, according to wireshark, the response from our server to Akamai is identical to the above response</p>
  
  <pre><code>HTTP/1.1 200 OK
  Content-Type: text/event-stream
  Server: Microsoft-IIS/7.5
  Expires: Mon, 07 Jan 2013 01:07:23 GMT
  Cache-Control: max-age=0, no-cache, no-store
  Pragma: no-cache
  Date: Mon, 07 Jan 2013 01:07:23 GMT
  Content-Length: 486
  Connection: keep-alive
  </code></pre>
  
  <p>Also in the first one, the connection stays open (as it should) and in the second it closes.</p>
  
  <p>UPDATE 3: This is purely an Akamai problem, we just switched to Edgecast &amp; they respond to the SSE connect correctly.</p>