What could cause Orchard HTML output to bloat?

Topics: Administration, Customizing Orchard, General
Apr 9, 2012 at 5:16 PM

I am very new to Orchard and I am still experimenting. I created a new theme based on Contoso using the approach described in the documentation with the  code generation tool. I haven't done much customization to it yet but I copied a few more of the original views and style files in order to be able to customize/experiment with them without damaging the original theme. I don't believe that I have done any changes to them yet. After a while I discovered that the theme's HTML footprint has bloated considerably and my frontpage alone seems to return an almost 1.5 MB HTML page without counting css and images. I haven't even added any real content yet, just a simple HTML widget with an image reference and a new content type for adding some simple body content without a title header. Switching back to other themes does not change this behavior but starting over with some clean App_Data does make the HTML look as expected again. What could cause this bloat?

Developer
Apr 9, 2012 at 8:21 PM

First of all: what do you see in the output (are there some patterns of repetition for example that could hint some loop gone wild)? 1,5MB for HTML indeed seems ridiculously big.

Developer
Apr 9, 2012 at 10:01 PM

Perhaps enabled Shape Tracing?

Apr 9, 2012 at 10:48 PM

Thanks a lot, I also found the reason in the mean time. Sure enough, I didn't look closer at first but there were tons of script tags like this or similar:

<script class="shape-tracing-wrapper" shape-id="41" shape-type="Style" shape-hint=""></script><script class="shape-tracing-wrapper" end-of="41"></script>

Disabling shape tracing removed the extra HTML. Now I know why it is disabled by default. An important thing to keep in mind before I push stuff to production :-) Wonder whether that could be made role sensitive as a precautionary feature so that normal users don't get affected by this. Currently it seems to affect all users no matter if you are logged in or not. Anyway, I am glad that the reason is found. Wouldn't feel comfortable otherwise. Thanks.