Slashdot Mirror


The ASP.NET Code Behind Whitehouse.gov

An anonymous reader writes "The author looks at the markup for the new whitehouse.gov site, launched today. It uses ASP.NET and various JavaScript libraries. It suffers from various inefficiencies, most easily remedied. Check the images and techniques used to build the site front-end."

14 of 143 comments (clear)

  1. Maybe we can by AKAImBatman · · Score: 3, Insightful

    The whitespace.gov site has lots of whitespace characters.

    Hmm... Freudian slip? FWIW, most of the whitespace is probably generated by the ASP technology they used. Spots where code goes can often generate unexpected whitespace. It's just a side effect of using scriptlet-type technologies.

    Don't get me started on the "correct" way to write ASP. The tag-substitution gobbldy-gook encourages all kinds of bad page-development practices. The request-time attributes + templating taglibs seen in JSP provide a much cleaner separation between logic and HTML.

    The whitehouse.gov site uses more GIFs than PNGs.

    Ouch. Welcome back to 1996. Web developers looking for the smallest file size really need to learn that there is such a thing as palletized PNGs. They're even smaller than GIFs, even.

    The whitehouse.gov site uses heavy JPG compression.

    This is one place where my reaction is "BFD". As long as it looks acceptable under most circumstances, the people with the carefully color calibrated monitors (*cough*yeslikeme*cough*) can suffer a bit. Heck, half the JPGs on the internet look like garbage, so I'm not too worried about artifacting in the gradients.

    The whitehouse.gov site uses IIS 6.0. The whitehouse.gov site uses ASP.NET 2.0.

    Can we choose the right technologies for a website? No we can't! Thankfully, the President isn't hired to choose the best technology to run his website. ;-)

    1. Re:Maybe we can by Xest · · Score: 4, Informative

      Whilst I'm a fan of PHP myself, I have to say the new ASP.NET MVC framework is rather good.

      It really does beat hands down anything in the PHP world in terms of how quickly you can get something up whilst maintaining quality. I'd argue partly this is because of the Visual Studio integration and the power of Visual Studio to start with.

      I wouldn't ever build a live app. in web forms, but I could be pretty tempted with the new MVC framework I have to admit. The various PHP frameworks out there that perform a similar task such as CakePHP could learn a lot from it in terms of how quickly you can build with it without the usual sacrifice of quality of software you get with Microsoft's tools (again, web forms for example).

      Of course, the thing is as well, the Microsoft platform is slowly getting better, Windows Server 2008 and IIS 7 really aren't that bad, performance isn't too much different to Apache/PHP now and security since .NET is much improved. Of course, Apache was always pretty good so to say IIS is improving doesn't mean much in that context but certainly combined with .NET MVC I think the whole LAMP platform needs to watch out. The various PHP frameworks like Cake could do things such as dropping the stupid cake bake crap that fails half the time on Windows and is pretty much undocumented (It has one page in the docs that don't explain much beyond what it's for). In contrast Symfony is absolutely fantastic on documentation and so is Zend, but it's still much more hassle, and there's still many more security pitfalls you have to keep an eye on vs. ASP.NET MVC.

      I'd probably like Java, but I've never used it professionally, only academically so can't compare with that. At the end of the day though, my point is that with ASP.NET MVC I can build a high quality site much more quickly and with much greater confidence than I can with any PHP framework right now.

  2. This page is a way by Nimey · · Score: 4, Insightful

    for the author to show his superiority to the Internet. None of what he cites really matters.

    --
    Hail Eris, full of mischief...

    E pluribus sanguinem
    1. Re:This page is a way by ergo98 · · Score: 3, Interesting

      for the author to show his superiority to the Internet. None of what he cites really matters.

      True enough. Indeed, the page in question actually validates as XHTML Transitional which is something that is remarkably rare and shows a concern for craftsmanship.

  3. Helpful advice?? by biocute · · Score: 4, Insightful

    Many developers use the JQuery from Google's servers for improved performance and lower latency.

    Is this guy serious? Advising Whitehouse.gov to use a remote server to serve javascripts?

    1. Re:Helpful advice?? by c_g_hills · · Score: 4, Insightful

      Who said anything about hacking? It's entirely feasible that they would change the script they serve up themselves. It would allow Google to track all visitors to the site who have javascript enabled, a possible privacy violation.

  4. well at least it's not... by Cyko_01 · · Score: 4, Insightful

    ...flash based!

  5. New robots.txt file by Cyclopedian · · Score: 5, Interesting

    The switchover of the whitehouse.gov site also meant that the robots.txt file has changed. From around 2400 lines to just 2 lines: http://www.kottke.org/09/01/the-countrys-new-robotstxt-file

    1. Re:New robots.txt file by hansamurai · · Score: 4, Funny

      Disallow: /firstlady/behindthescenes/text

      Can't wait to crawl that one.

  6. Campaign servers ran open source by rwa2 · · Score: 4, Informative

    http://www.linuxjournal.com/content/open-source-force-behind-obama-campaign

    My take is that the whitehouse.gov servers are run by the government and have to conform to DoD security guidelines, which have only relatively recently included Linux configurations for certain commercial distributions such as Redhat. So they probably don't have the freedom to redo the servers with whatever they could cobble together with talented volunteers for the campaign.

    Anyway, we'll eventually see whether all this talk of change only runs skin deep.

  7. Engineering nerds, this is an example! by Anonymous Coward · · Score: 5, Insightful

    You will encounter this sometimes in your life, and you better get used to it. Sometimes, believe it or not, things are done simply because they need to be done.

    They don't spend a lot of time laboring over every little detail, they have a list of tasks and a deadline and they do their best to meet the deadline.

    They anticipate that nerds who nitpick Battlestar Galactica episode continuity errors will likely come in and stroke their butter soaked neck beards and chortle about how this or that could be done better to achieve 5% faster page loads, or allow for translation into Swahili.

    But, they get paid either way and in the grand scheme of things trying to impress anyone on Slashdot is probably pretty low on anyone's to-do list.

    As someone who's argued with people about vi vs. emacs in the past, I can honestly say you guys have reached a new low both in wasting time, having no worthwhile point, and being worthless slashdot editors. The trifecta.

  8. What is this ignorance? by KlomDark · · Score: 4, Informative

    I just love when people who know nothing about ASP.NET attempt to critique things:

    The whitehouse.gov site has long ASP.NET IDs. There are many elements on the page that have very long IDs, which are mainly a waste of bandwidth usually. They could be easily removed on the server side.

    <a id="ctl09_rptNavigation_ctl00_rptNavigationItems_ctl01_hlSubNav"...

    Sorry bud, they can't really be removed on the server side - these are controls embedded in controls embedded in controls. Maybe a slight shaving of rptNavigationItems down to rptNavItms or something, but the long name is to be able to reference the embedded controls.

    Please try again...

  9. Re:The fact that he uses them makes them the best. by MindStalker · · Score: 3, Insightful

    Technically its the same server and software that was on whitehouse.gov yesterday under the Bush Administration. Like the Defense Secretary, keeping the stuff that works and would be a hassle to change around for right now.

  10. Pick the low hanging fruit. by mr+sharpoblunto · · Score: 3, Interesting
    Most of the optimization suggestions in TFA are going to offer no real performance benefit. With gzip on, whitespace, long ID's & viewstate make pretty much no impact on the final page weight, but doing these "optimizations" is going to make your page a hell of a lot harder to maintain. Don't believe me, go to webpagetest.org and have a look, HTML accounts for only around 5% of the final page size. The best thing these guys could do to optimize the site would be to
    • combine the css and javascript files.
    • minify the javascript (as it is its taking up around 20% of the page weight)
    • perform more aggressive css spriting of the gif and jpeg images to slash the request count further.
    • remove ETag headers and add far future expiry headers to the images to speed up repeat page views and cut down on 304 responses from the server.

    Who cares about a 30 byte http header when your page is over 800k and ~45 requests, there's plenty of low hanging fruit to pick first. Interesting thing is in the post above a tool called the rpo is mentioned, it seems to do most of the important optimizations automatically.