Question

i know we can compress response by declaring Response.Filter as GZip or Delfalte streams, but how i can perform both compression and minification together? declaring new class that inherits Stream, then first performing minify on content, then compress that by GZip or Deflate depending on User-Agent supported each?

Was it helpful?

Solution 2

hm... 2 days and nothing. check out Mads Kristensen approach http://madskristensen.net/post/A-whitespace-removal-HTTP-module-for-ASPNET-20.aspx. however this isn't exactly that i want but is better than nothing ;)

OTHER TIPS

For javascript & css files, you can minify them using Microsoft Ajax Minifier 4.0.
You can also use Microsoft Ajax Minifier as a Build Task.

For response compression, you are on the right way, you can use Response.Filter and use either GZip or Delfalte streams.
For a sample code for using Response.Filter, refer to the following article Combining, Compressing, Minifying ASP.NET ScriptResource and HTML Markups.

Also, you can use IIS to compress content.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top