Introduction
Intersoft's main framework, the WebUI.NET Framework extensively utilizes XML as its main storage for client side settings. There are many advantages by using XML compared to traditional approaches which writes unstructured Array or lot of scripts for client side settings. For instance, the state can be easily managed, accessed, changed and updated in consistent fashion and structured manner. There's one weakness though, a big price that has to be paid for all advantages, which is the xml produces a bit larger output since its tag name and attributes are self describing. XmlCompression is born to solve this dillema! Intersoft developed its own compression and decompression algorithm in order to compress the XML storage into 40-60% smaller size. This significantly improves the performance of page load in narrow bandwidth. This technology is also extensively used in FlyPostBack technology to reduce the posted string and overally improve response time to 40%.
Comparison
The following shows xml sample of a control's instance and compares the uncompressed and compressed output.
Uncompressed (Original) - 5 KB
<
xml id='WebDesktopManager1_x'>
<
WebDesktopManager FrameStyle="W5980" ShortcutIconsVisible="True" TaskBarStyle="W6262" EnableContextMenu="True" OptimizeCss="True" OptimizeCssName="True" GroupCssStyles="False" ServerUniqueID="WebDesktopManager1" xmlInputHiddenUniqueID="WebDesktopManager1$WebDesktopManager1_h">
<
Windows>
<
WebDesktopWindow Text="Disabled Samples" Name="wndDisabledSamples" ControlBoxImage="~/Images/X-16.gif" />
<
WebDesktopWindow Text="Welcome to WebDesktop.NET" Name="wndWelcome" />
</
Windows>
<
ShortcutIcons>
<
WebDesktopShortcut Name="scWelcome" Text="Welcome to WebDesktop.NET" Image="/WebDesktopSamples/Images/welcome-32.gif" WindowName="wndWelcome" ToolTip="Display Welcome screen." TargetControlBoxImage="/CommonLibrary/Images/WebDesktop/" />
<
WebDesktopShortcut Name="scWebPad" Text="WebPad" Image="/WebDesktopSamples/Images/webpad-32.gif" TargetURL="WebPad.aspx" WindowName="wndWebPad" ToolTip="The Web version of Notepad. Featuring Tabbed interface for text editing and Dockable Toolbar." TargetControlBoxImage="/WebDesktopSamples/Images/webpad-16.gif" />
<
WebDesktopShortcut Name="scWebOutlook" Text="WebOutlook" Image="/WebDesktopSamples/Images/outlook-32.gif" TargetURL="WebOutlook.aspx" WindowName="wndWebOutlook" ToolTip="The Web version of Outlook, demonstrating WebPaneManager.NET" TargetControlBoxImage="/WebDesktopSamples/Images/outlook-16.gif" />
<
WebDesktopShortcut Name="scNewEmail" Text="Write Email" Image="/WebDesktopSamples/Images/writemail-32.gif" TargetURL="NewEmail.aspx" WindowName="wndNewEmail" ToolTip="Demonstrate integration with WebCombo.NET" TargetControlBoxImage="/CommonLibrary/Images/WebDesktop/" />
<
WebDesktopShortcut Name="scExplorer" Text="WebExplorer" Image="/WebDesktopSamples/Images/webexplorer-32.gif" TargetURL="Explorer.aspx" WindowName="wndExplorer" Visible="False" ToolTip="The Web version of Windows Explorer, demonstrating WebGrid.NET Enterprise integration." TargetControlBoxImage="/CommonLibrary/Images/WebDesktop/" />
<
WebDesktopShortcut Name="scChangeStyle" Text="Change Desktop Style" Image="/WebDesktopSamples/Images/style-32.gif" TargetURL="ChangeStyle.aspx" WindowName="wndChangeStyle" ToolTip="Select theme for the Desktop" TargetControlBoxImage="/WebDesktopSamples/Images/style-16.gif" />
<
WebDesktopShortcut Name="scMyCust" Text="My Customers" Image="/WebDesktopSamples/Images/mycust-32.gif" TargetURL="MyCustomers.aspx" WindowName="wndMyCust" Enabled="False" ToolTip="A sample application using Northwind database. Demonstrating WebDialogBox, WebMenu, and the entire WebUI Studio.NET integration." TargetControlBoxImage="/CommonLibrary/Images/WebDesktop/" />
<
WebDesktopShortcut Name="scSampleByProducts" Text="Sample by Products" Image="/WebDesktopSamples/Images/sample-32.gif" WindowName="wndSampleByProducts" TargetControlBoxImage="/WebDesktopSamples/Images/sample-16.gif" />
</
ShortcutIcons>
<
TaskBarSettings />
<
ImagesSettings />
<
WindowSettings ScrollBarCssClass="" ContainerStyle="W9473" CommandButtonDisabledStyle="W11519">
<
WindowStyle Normal="W10016" Over="W9639" Active="W9992" />
<
CaptionStyle Normal="W10160" Over="W9783" Active="W10136" />
<
CaptionButtonStyle Normal="W11334" Over="W10957" Active="W11310" />
<
CommandButtonStyle Normal="W11257" Over="W10880" Active="W11233" />
</
WindowSettings>
<
ClientSideEvents OnWindowCreating="OnWindowCreating" />
<
TextSettings />
<
ShortcutSettings />
<
TaskBarButtonStyle Normal="W8515" Over="W8138" Active="W8491" />
<
ShortcutStyle Normal="W7790" Over="W7413" Active="W7766" />
<
MenuStyles>
<
System FrameStyle="W9064" SeparatorStyle="W9925" HasBackgroundStrip="False" BackgroundStripColor="FFFFFF" BackgroundStripColor2="C4C3AC">
<
ItemStyle Normal="W10001" Over="W9624" Active="W10036" />
<
DisabledItemStyle Normal="W11342" Over="W10965" Active="W11318" />
<
CheckedItemStyle Normal="W11114" Over="W10737" Active="W11149" />
</
System>
<
Application FrameStyle="W9915" SeparatorStyle="W10776" BackgroundStripColor="FFFFFF" BackgroundStripColor2="C4C3AC">
<
ItemStyle Normal="W10852" Over="W10475" Active="W10828" />
<
DisabledItemStyle Normal="W12193" Over="W11816" Active="W12169" />
<
CheckedItemStyle Normal="W11965" Over="W11588" Active="W11941" />
</
Application>
</
MenuStyles>
</
WebDesktopManager>
</
xml>
Compressed - 3.5 KB
<
CompressedXml>
<
WebDesktopManager a="W5980" ShortcutIconsVisible="b" TaskBarStyle="W6262" EnableContextMenu="b" OptimizeCss="b" OptimizeCssName="b" GroupCssStyles="d" ServerUniqueID="e" XmlCompressionEnabled="b" xmlInputHiddenUniqueID="e$WebDesktopManager1_h">
<
Windows>
<
C k="Disabled Samples" l="wndDisabledSamples" ControlBoxImage="~/k/X-m.n" />
<
C k="o p q.r" l="s" />
</
Windows>
<
ShortcutIcons>
<
E l="scWelcome" k="o p q.r" n="/u/k/welcome-w.n" o="s" p="Display o screen." q="/z/k/q/" />
<
E l="scWebPad" k="ab" n="/u/k/ac-w.n" r="ab.ad" o="wndWebPad" p="af ag ah ai Notepad. Featuring Tabbed interface an text editing aq Dockable Toolbar." q="/u/k/ac-m.n" />
<
E l="scWebOutlook" k="au" n="/u/k/av-w.n" r="au.ad" o="wndWebOutlook" p="af ag ah ai Outlook, ay WebPaneManager.r" q="/u/k/av-m.n" />
<
E l="scNewEmail" k="Write Email" n="/u/k/writemail-w.n" r="NewEmail.ad" o="wndNewEmail" p="Demonstrate bh with WebCombo.r" q="/z/k/q/" />
<
E l="scExplorer" k="WebExplorer" n="/u/k/webexplorer-w.n" r="Explorer.ad" o="wndExplorer" Visible="d" p="af ag ah ai Windows Explorer, ay WebGrid.r Enterprise bh." q="/z/k/q/" />
<
E l="scChangeStyle" k="Change bv Style" n="/u/k/bx-w.n" r="ChangeStyle.ad" o="wndChangeStyle" p="Select theme an cc bv" q="/u/k/bx-m.n" />
<
E l="scMyCust" k="My Customers" n="/u/k/mycust-w.n" r="MyCustomers.ad" o="wndMyCust" Enabled="d" p="A ck application using Northwind database. Demonstrating WebDialogBox, WebMenu, aq cc entire WebUI Studio.r bh." q="/z/k/q/" />
<
E l="scSampleByProducts" k="Sample by Products" n="/u/k/ck-w.n" o="wndSampleByProducts" q="/u/k/ck-m.n" />
</
ShortcutIcons>
<
TaskBarSettings />
<
ImagesSettings />
<
WindowSettings ScrollBarCssClass="" ContainerStyle="W9473" CommandButtonDisabledStyle="W11519">
<
WindowStyle x="W10016" y="W9639" z="W9992" />
<
CaptionStyle x="W10160" y="W9783" z="W10136" />
<
CaptionButtonStyle x="W11334" y="W10957" z="W11310" />
<
CommandButtonStyle x="W11257" y="W10880" z="W11233" />
</
WindowSettings>
<
ClientSideEvents OnWindowCreating="OnWindowCreating" />
<
TextSettings />
<
ShortcutSettings />
<
TaskBarButtonStyle x="W8515" y="W8138" z="W8491" />
<
ShortcutStyle x="W7790" y="W7413" z="W7766" />
<
MenuStyles>
<
System a="W9064" ab="W9925" HasBackgroundStrip="d" ad="dx" ae="dy">
<
T x="W10001" y="W9624" z="W10036" />
<
U x="W11342" y="W10965" z="W11318" />
<
V x="W11114" y="W10737" z="W11149" />
</
System>
<
Application a="W9915" ab="W10776" ad="dx" ae="dy">
<
T x="W10852" y="W10475" z="W10828" />
<
U x="W12193" y="W11816" z="W12169" />
<
V x="W11965" y="W11588" z="W11941" />
</
Application>
</
MenuStyles>
</
WebDesktopManager>
<
ISXMLMapping>
<
NodeKey>VUTEC</NodeKey>
<
NodeValue>CheckedItemStyleDisabledItemStyleItemStyleWebDesktopShortcutWebDesktopWindow</NodeValue>
<
AttrKey>zadaeanlxyabqrkpo</AttrKey>
<
AttrValue>ActiveBackgroundStripColorBackgroundStripColor2FrameStyleImageNameNormalOverSeparatorStyleTargetControlBoxImageTargetURLTextToolTipWindowName</AttrValue>
<
ValKey>mwaqaddyzaybvddxannkbhraiavckbxccafpbahagqeuauacabos</ValKey>
<
ValValue>1632andaspxC4C3ACCommonLibrarydemonstratingDesktopFalseFFFFFFforgifImagesintegrationNETofoutlooksamplestyletheThetoTrueversionWebWebDesktopWebDesktopManager1WebDesktopSamplesWebOutlookwebpadWebPadWelcomewndWelcome</ValValue>
</
ISXMLMapping>
</
CompressedXml>
![]() |
The more redundant tags, attributes or values in the XML, the larger its saving percentage. The Xml Compressor works by checking redundant tags or attributes and map it with unique one character. Enabling Xml Compressor can also help you to prevent sensitive data to be seen by users (via View Source) since the Xml appears in kind of obfuscated form which makes it nearly impossible to be read. |
How to enable XML Compressor
Xml Compressor can be enabled by using one of following techniques:
- Individual control's configuration
All Intersoft's components that built upon WebUI.NET Framework 3.0 will automatically expose XmlCompressionEnabled property. This property is set to False by default. You can set it to True to enable xml compression for that specific instance.
- Application wide configuration per product
You can also administer a certain product to have all its instances to use xml compression in the entire application. This can be done by adding following key under <appSettings> in web.config. Note that the following sample will only affect "WebDesktop V1.0.2006" component (also includes all components inside WebDesktop)
<add key="ISNet.WebUI.WebDesktop.v1_5_2006.XmlCompressionEnabled" value="true"></add>
Supported Products
This section lists the products which have been implemented to support Xml Compressor.
- WebGrid.NET Enterprise 4.0 for Visual Studio 2005 (Build 4.0.6200.257+)
- WebCombo.NET 3.0 for Visual Studio 2005 (Build 3.0.5000.257+)
- WebInput.NET 2.0 for Visual Studio 2005 (Build 2.0.5000.2511+)
- WebDesktop.NET 1.0 for Visual Studio 2005 (Build 1.0.2006.1+)
Benefits
The following lists some of the top benefits offered by XmlCompressor:
- Faster page load performance with reduced output size.
- Enables better scalability and extensibility as the application become richer in features.
- Does not sacrifice the main function of Xml-based storage.
- Faster response time when enabled in FlyPostback supported controls.
