GZip and Deflate Compression Filter for ASP.Net MVC

Submitted on May 02, 2009, 2:17 p.m.

I’d previously created a compression processor for dynamic content – using this excellent post for QValues by Dave Transom. Also just just discovered this post on creating an action filter for compression by Kazi Manzur Rashid.

So combining the two and we have:

1

Which when applied as below to any action method will enable compression if it’s supported by the browser.

1

Download here: QValueAndCompressionFilter.zip