This project has moved. For the latest updates, please go here.

WebMarkupMin does not minify html content on POST

Aug 23, 2014 at 4:40 AM
Edited Aug 23, 2014 at 4:40 AM
I noticed something interesting, WebMarkupMin won't minify the content for Http POST request. The GET requests are getting minified correctly with no issue. I have all the configuration in place correctly. Am I missing anything. It's bit cumbersome to place [MinifyHtml] filter on every single action in the controller. Please suggest.
<modules runAllManagedModulesForAllRequests="true">
  <add name="HtmlMinificationModule" type="WebMarkupMin.Web.HttpModules.HtmlMinificationModule, WebMarkupMin.Web" />
  <add name="XmlMinificationModule" type="WebMarkupMin.Web.HttpModules.XmlMinificationModule, WebMarkupMin.Web" />
</modules>

 <webMarkupMin xmlns="http://tempuri.org/WebMarkupMin.Configuration.xsd">
<core>
  <html whitespaceMinificationMode="Medium" removeHtmlComments="true"
        removeHtmlCommentsFromScriptsAndStyles="true"
        removeCdataSectionsFromScriptsAndStyles="true"
        useShortDoctype="true" useMetaCharsetTag="true"
        emptyTagRenderMode="NoSlash" removeOptionalEndTags="true"
        removeTagsWithoutContent="false" collapseBooleanAttributes="true"
        removeEmptyAttributes="true" attributeQuotesRemovalMode="Html5"
        removeRedundantAttributes="true"
        removeJsTypeAttributes="true" removeCssTypeAttributes="true"
        removeHttpProtocolFromAttributes="false"
        removeHttpsProtocolFromAttributes="false"
        removeJsProtocolFromAttributes="true"
        minifyEmbeddedCssCode="true" minifyInlineCssCode="true"
        minifyEmbeddedJsCode="true" minifyInlineJsCode="true" />
  <css defaultMinifier="KristensenCssMinifier">
    <minifiers>
      <add name="NullCssMinifier" displayName="Null CSS Minifier" type="WebMarkupMin.Core.Minifiers.NullCssMinifier, WebMarkupMin.Core" />
      <add name="KristensenCssMinifier" displayName="Mads Kristensen's CSS minifier" type="WebMarkupMin.Core.Minifiers.KristensenCssMinifier, WebMarkupMin.Core" />
    </minifiers>
  </css>
  <js defaultMinifier="CrockfordJsMinifier">
    <minifiers>
      <add name="NullJsMinifier" displayName="Null JS Minifier" type="WebMarkupMin.Core.Minifiers.NullJsMinifier, WebMarkupMin.Core" />
      <add name="CrockfordJsMinifier" displayName="Douglas Crockford's JS Minifier" type="WebMarkupMin.Core.Minifiers.CrockfordJsMinifier, WebMarkupMin.Core" />
    </minifiers>
  </js>
  <logging>
    <loggers>
      <add name="NullLogger" displayName="Null Logger" type="WebMarkupMin.Core.Loggers.NullLogger, WebMarkupMin.Core" />
      <add name="ThrowExceptionLogger" displayName="Throw exception logger" type="WebMarkupMin.Core.Loggers.ThrowExceptionLogger, WebMarkupMin.Core" />
    </loggers>
  </logging>
</core>
<webExtensions enableMinification="true" disableMinificationInDebugMode="true"
         enableCompression="true" disableCompressionInDebugMode="true"
         maxResponseSize="100000" />
</webMarkupMin>
Coordinator
Aug 23, 2014 at 6:50 AM
Hello, Mycodeplex747!

This is done intentionally, because the result of POST request cannot be cached.