OK, I barely remember "Name that tune", but I think the meme is widespread enough for even the average juvenile dev to know. (for those even younger than I can imagine: NTT was a gameshow where people did a "reverse auction" to select how many notes they needed before they could name a song. Guess right, and you win big -- like a couch or something).
Anyway, this thought went through my head as I was looking at the source for an anonymous Web site about TechEd sessions today. I noticed that the page was 161,000+ bytes. Yes. Over 150KB. 32KB of which were ViewState.
Let that sink in a little bit. How about this. That's just over 13 pages in Word (and about 30 pages using manuscript format if my memory serves). For a form with four fields.
When I was at a past job, I was a little frightened at some of the people asking me "Why do you have EnableViewState set to false on that control?" The number of people seemingly willing to blindly dump KB of essentially junk at their users is horrid. If you don't need that ViewState, for gosh sake, *Turn it off!* If I were a (heavens forfend) 56KB modem user, as many people still are, that would be awful. Well, don't take my word for it, here's part of the report from WebSiteOptimization.com:
Download Times*
| Connection Rate |
Download Time |
| 14.4K |
162.16 seconds |
| 28.8K |
81.18 seconds |
| 33.6K |
69.61 seconds |
| 56K |
41.85 seconds |
| ISDN 128K |
12.95 seconds |
| T1 1.44Mbps |
1.31 seconds |
What can you do to avoid this epidemic of morbidly obese Web pages? Well, to start, read Scott Mitchell's "Understanding ViewState". Or Dino's "The ASP.NET View State". Or Susan Warren's "Taking a bite out of ViewState". Then, try turning off ViewState on controls, especially Repeaters, DataGrids, DataViews and GridViews that are populated in Page_Load anyway. Your users will be happier, making your boss happier, making you get a huge bonus and company car.
Or maybe I'll just stop whinging at you.
Print | posted on Saturday, June 10, 2006 6:01 AM