Pearce
Pearce

Reputation: 330

Minified ASPX with no white space, but in browser displays fully indented and formatted

I have minified my aspx pages with an external application that simply removes white space. I am not doing this on the fly at compile/runtime. Clearly my pages are minified as I can open them up in a text editor and there is no white space and the file size is dramatically smaller.

I upload it to the server, yet no matter what browser I display in, the source code appears formatted exactly is it did before. What would be the reason for this? of course I have cleared cache. It is almost like google pre formats your source code for readability but I have seen other websites that can achieve the desired result..and google.com is clearly all dried up of whitespace

Thoughts?

Upvotes: 0

Views: 107

Answers (1)

Code Uniquely
Code Uniquely

Reputation: 6373

How exactly are you checking for the layout?

Most modern browsers have built in "Pretty Print" formatting by default, especially if you use any of the built in tools / inspectors.

In order to check that the download content really contains, use a tool like Fiddler or something similar and and then take a look at the response using the Raw or HexView tabs to get and idea of what's actually been sent down to the browser in terms of bytes.

If you're aren't seeing lots of spacing (in raw view) or 20 or 09 in hex view then you're not sending the whitespace and its the browser trying to be helpful.

Upvotes: 1

Related Questions