I’ve wrote very simple minification/compression handler that minify css and js by indicating request type (Request.RawUrl.EndsWith("css" || "js")), but i don’t know an approach to indicate which response type is html and then minify that as HTML-content because in mvc isn’t extension to checking.
thanks in advance 😉
If you wrote an HTTP handler to compress static resources it’s up to you to set up the
Content-Typeheader based on the file type:Btw I would recommend you to minify/compress your static resources in advance and rely on the web server’s
gzipcompression and client caching. I would avoid writing such handlers if it’s not education purposes.