Remove Whitespace From aspx pages - Performance with page speed
Some web page have a thousand line of html code and it will increase the size of the page to download to users. It is often possible to make a content of web page fewer bytes(their size) without changing the appearance or function of the page. This approach will improve download time and makes the page load faster. The question how to make this happen without extra effort to remove the space manually and without effect the development time. This is a snippet code that you need to put in your Master page so that the code will automatically override the Render Event in asp.net The Code to put in Master Page The Attribute/Field for masterpage private static readonly Regex REGEX_BETWEEN_TAGS = new Regex(@">\s+<", RegexOptions.Compiled); private static readonly Regex REGEX_LINE_BREAKS = new Regex(@"\n\s+", RegexOptions.Compiled); The Override Method /// <summary> /// Initializes the <see cref="T:System.Web.UI.HtmlTextWriter"...