DEV Community

Kumar Swapnil
Kumar Swapnil

Posted on

A step towards a faster Web: Early flushing in

A simple demonstration to Early flushing in dotnet.

Flushing, Early flushing, head flushing or Progressive HTML is when the server sends the initial part of the HTML document to the client before the entire response is ready. All major browsers start parsing the partial response.If done correctly, the browser won't sit idle after requesting your page, rather, it can start process other important things in the meantime, like requesting static assets which would be used later on the site. It could give a significant perceived performance gain.
In this given example, I have used Thread.Sleep(200). This could be the time where your page does heavy database calls and other computation.


public ActionResult Index()

  return PartialView("/Views/Home/Index.cshtml");


<!DOCTYPE html>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src=""></script>
    <title>Hey - My ASP.NET Application</title>


    <div class="row">
        Hey there, How u doin'?

Results With Early Flushing:

With Early flushing

Results Without Early Flushing

Without Early flushing

Top comments (0)