ASP.NET Weblogs

Welcome to ASP.NET Weblogs Sign in | Join | Help
in Search

Josh Schwartzberg high-fives the CLR

and plays with his shiny golden hammer....

MVC/JQuery meets X-Mas Music Project

MetalXmas.com


My friend Dave and I embarked on a project a few weeks ago, initially just meant to be an audio CD for our family, that included some rockin' versions of everyone's christmas favorites.  As we started to record it, we got more and more excited about how it might turn out.  Being the uber code master that I am, I opted to make a website... then in a blink, a friend who is incredible at Flash offered to help. This turned out to be a great experience for all of us, and the feedback has been tremendous. 

I'm very proud to share with you (make sure your speakers are on) www.metalxmas.com 

The code-behind
I wanted to have a spot for friends, family, and haters to post their honest ramblings, so I decided to go with the much-loved JQuery/ASP.NET MVC combo; what a joy as always.  One bug I ran into, that seems to have been noticed before me, is the ability to cache the root page of your ASP.NET MVC site using the OutputCache attribute.  According to this thread, the mvc team will have a fix soon.  For the time-being, I ended up caching at the repository level by just sticking the data response from disk into the HttpContext cache to ensure I only read and parse my xml file every 10 seconds.

Nothing else too interesting came up. I added some spam protection, input validation (client and server-side), and HtmlEncoding to protect any hijacks.  All in all, another great experience.  I would share the code, but I have a certain Oxitephobia.

Scalability
In the hopes (and delusions of grandeur) of this thing being picked up as even a semi-viral hit.  I wanted to make sure the site wouldn't go down.  I placed the flash file, the four mp3 files, the images, and the css file on a CDN.  I initially started with Amazon S3... but at 15cents/gig compared to SimpleCDN's 6cents/gig I had to switch.  I've been very happy with my experience, and they even include $15 worth of free credit when you first sign-up.  A friend of mine suggested I use the YSlow plugin to analyze my site; this ended up with the following configuration:

  • HTTP Compression enabled on CDN (via url configuration) and IIS (c'mon, if you haven't done this yourself already, DO IT NOW)
  • Set content expiration on all files on CDN to have 10 year expiration headers (I named the files themselves with version numbers to allow for forcefully expiring if needed)
  • JQuery and SWFObject scripts hosted via google
  • All scripts at the bottom
  • XHTML 1.0 Strict validated by W3

This ended me with an A score with YSlow.  I felt accomplished.

Parting thoughts
I hope you enjoy it, it's definitely meant to be funny - so don't take it too seriously.  Feel free to pass it along to your friends and family!

Published Dec 15 2008, 09:26 PM by dotjosh
Filed under: , ,

Comments

 

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

December 15, 2008 10:34 PM
 

ASP.NET MVC Archived Blog Posts, Page 1 said:

Pingback from  ASP.NET MVC Archived Blog Posts, Page 1

December 16, 2008 10:09 AM
 

Dew Drop - December 16, 2008 | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop - December 16, 2008 | Alvin Ashcraft's Morning Dew

December 16, 2008 11:00 AM
 

Lance said:

Hopefully you'll reconsider sharing the code.  Even if it's not perfect, it sounds like a great bit of learning material.

Either way, thanks for sharing this!

December 16, 2008 7:31 PM
 

Kenny Eliasson said:

Actually, its not good that developers are in fear of eachother now thanks to all this Oxite talk. Dev's should not be afraid of sharing code because of other devs.

December 17, 2008 3:13 AM
 

dotjosh said:

It was actually more of a joke.  I'm going to do a followup post with the actual code sometime soon.

December 17, 2008 12:05 PM
 

karl said:

Just don't say TDD fanboys are gonna love it and come out with 4 bizzilion lines of code and 51 tests :P

December 22, 2008 1:48 PM
 

Ventego said:

Interesting and informative. But will you write about this one more?

October 27, 2009 5:11 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit