title: Final message in server events not being pushed until heartbeat
body: <p>We are having an issue with the final message sent over service stack waiting until the next heart beat to be sent. We believe it to be similar to :</p>
  
  <p><a href="https://stackoverflow.com/questions/25960723/servicestack-server-sent-events/25983774">Servicestack server sent events</a></p>
  
  <p>However, res.Write() is now deprecated and res.WriteAsync() throws:</p>
  
  <pre class="lang-none prettyprint-override"><code>System.InvalidOperationException: This operation cannot be performed after the response has been submitted
  </code></pre>
  
  <p>I have also tried to solve the issue stated in the above thread by using  : </p>
  
  <pre class="lang-cs prettyprint-override"><code>// Remove url compression https://stackoverflow.com/questions/53559038/asp-net-core-disable-response-decompression
  // because of https://stackoverflow.com/questions/25960723/servicestack-server-sent-events
  services.AddResponseCompression(options =&gt;
  {
      var gzip = options.Providers.OfType&lt;GzipCompressionProvider&gt;().FirstOrDefault();
      if (gzip != null)
      {
         options.Providers.Remove(gzip);
      }
  });
  </code></pre>
  
  <p>Would appreciate a push in the correct direction to addressing this issue as the currently accepted solution to this issue is no longer viable. </p>