The source for my CourtesyFlush NuGet package.
C# JavaScript HTML CSS ASP
Latest commit bd4503f Dec 14, 2015 @nikmd23 Merge pull request #17 from drayfar/master
Add fallback logic for AntiForgeryToken, don't send a new AntiForgeryToken cookie on every request
Permalink
Failed to load latest commit information.
.nuget
source
.gitattributes
.gitignore Initial commit Mar 17, 2014
CourtesyFlush.sln
LICENSE Initial commit Mar 17, 2014
README.md
banner.jpg Added graphic assets Jul 18, 2014
icon128.png
icon32.png

README.md

CourtesyFlush

A library to simplify flushing HTTP responses early in ASP.NET MVC.

CourtesyFlush

Installation

CourtesyFlush can be installed via NuGet:

Install-Package CourtesyFlush

Why Flush Early?

Flushing early can provide performance improvements in web applications and has been a recomended best practice in the web performance community since 2007.

To find out more, check out my blog where I covered the benefits of flushing early in two posts:

Usage

CourtesyFlush is easy to use. It builds on top of common ASP.NET MVC Action Filter functionality.

A full writeup of how to use CourtesyFlush is availble on my blog.

Release Notes

1.1

  • Added support for AntiForgeryTokens. Example usage:

    // The "GET" action that includes the token...
    [HttpGet, FlushHead(Title = "Flushed Title", FlushAntiForgeryToken = true)]
    public ActionResult Register()
    {
        return View();
        // Inside this view, call @Html.FlushedAntiForgeryToken() instead of @Html.AntiForgeryToken()
    }
    
    // The "POST" action with standard ValidateAntiForgeryToke attribute 
    [HttpPost, ValidateAntiForgeryToken]
    public ActionResult Register(string username, string password)
    {
        // handle valid request here
    }

    NOTE: AntiForgeryToken support only available in .NET 4.5

1.0

  • Re-branded from PerfMatters.Flush to CourtesyFlush