Markup compression

Sep 28, 2009 at 7:12 PM

Hello,

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?

 

Thanks,

Chris

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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
	Untitled Page
</title>
    
    <script type="text/javascript">
        swfobject.embedSWF("test.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf");
		</script>
		
		
		
<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>
<body>
    
    <form name="form1" method="post" action="default.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">

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

<script type="text/javascript">
//<![CDATA[
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;
        theForm.submit();
    }
}
//]]>
</script>

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.