Markup compression

Sep 28, 2009 at 7:12 PM


Thanks for making this library!

I tried running the QuickStart project locally. It compresses css and js fine, but no markup compression is taking place. Any idea why this is so?




Sep 28, 2009 at 8:04 PM

The QuickStart project is working perfectly.

How did you check that the page is not been compressed?

Sep 28, 2009 at 8:20 PM

I downloaded the latest version of source and built it and ran it using Visual Studio 2008's built-in server (F5).

The markup it produced wasn't being minified:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
	Untitled Page
    <script type="text/javascript">
        swfobject.embedSWF("test.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf");
<style type="text/css">
	.Menu1_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; }
	.Menu1_1 { text-decoration:none; }
	.Menu1_2 {  }

</style><link type="text/css" href="css.axd?d=style.css&amp;v=1" rel="stylesheet" /><link type="text/css" href="style/css.axd?d=articles.css,style.css&amp;v=1" rel="stylesheet" /><link type="text/css" href="App_Themes/Default/css.axd?d=Copy%20of%20theme.css,theme.css&amp;v=1" rel="stylesheet" /><script type="text/javascript" src="Scripts/jslib.axd?d=common.js,jquery-1.2.6.js&amp;v=1"></script><script type="text/javascript" src="jslib.axd?d=core.js&amp;v=1"></script></head>
    <form name="form1" method="post" action="default.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">

<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />

<script type="text/javascript">
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;

Sep 28, 2009 at 8:26 PM

The library is not minifying HTML. Only js and css.

The pages are only been compressed.

Sep 28, 2009 at 8:32 PM

Oh I see.

Did you look into minifying HTML?

Sep 28, 2009 at 8:39 PM

Actually I did. The first version of MbCompression did minify HTML, but It made more damage than benefits, so I cancel this option.