views:

40

answers:

1

When i request a page using browser / AJAX request i see lot of spaces and newlines which i think must be adding some overhead for retrieving the response as they too belong to characters means bytes and size. right ?

Is there some way it can be removed while sending from the server ? how ? (I am using IIS and asp.net for development)

+2  A: 

There are some http modules that make all ready what you ask

For example here is one
http://madskristensen.net/post/A-whitespace-removal-HTTP-module-for-ASPNET-20.aspx

How ever in some cases in my opinion is that you do not need to do that because you spend more time on server clearing the page, than send it, especial if it is gZipped. One good solution is to manual cache the final clear page, and then send the cached (update it when its needed etc), but this is a lot more code.

Also similar questions
http://stackoverflow.com/questions/2272024/asp-net-mvc-actionfilter-for-remove-empty-lines-in-result

http://stackoverflow.com/questions/2272024/asp-net-mvc-actionfilter-for-remove-empty-lines-in-result

http://stackoverflow.com/questions/255008/minify-html-output-of-asp-net-application

And the keys to search on google is "Minify Html"

Aristos