<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Josh Schwartzberg high-fives the CLR : ASP.NET</title><link>http://weblogs.asp.net/dotjosh/archive/tags/ASP.NET/default.aspx</link><description>Tags: ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>MVC/JQuery meets X-Mas Music Project</title><link>http://weblogs.asp.net/dotjosh/archive/2008/12/15/mvc-jquery-meets-x-mas-music-project.aspx</link><pubDate>Tue, 16 Dec 2008 02:26:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6789309</guid><dc:creator>dotjosh</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/dotjosh/rsscomments.aspx?PostID=6789309</wfw:commentRss><comments>http://weblogs.asp.net/dotjosh/archive/2008/12/15/mvc-jquery-meets-x-mas-music-project.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;&lt;A title=MetalXmas.com href="http://www.metalxmas.com/" target=_blank mce_href="http://www.metalxmas.com"&gt;&lt;IMG style="WIDTH: 320px; HEIGHT: 303px" title=MetalXmas.com border=0 hspace=15 alt=MetalXmas.com vspace=5 align=right src="http://weblogs.asp.net/blogs/dotjosh/metalxmas_blogpost.jpg" width=320 height=261 mce_src="http://weblogs.asp.net/blogs/dotjosh/metalxmas_blogpost.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;BR&gt;My friend&amp;nbsp;Dave and I embarked on a project a few&amp;nbsp;weeks ago, initially just meant to be an audio CD for our family, that included&amp;nbsp;some rockin' versions of everyone's christmas&amp;nbsp;favorites.&amp;nbsp; As we started to record it, we got more and more excited about how it might turn out.&amp;nbsp; Being the uber code master that I am, I opted to make a website... then in a blink, a friend who is &lt;A title=JoeyShipley.com href="http://www.joeyshipley.com/" target=_blank mce_href="http://www.joeyshipley.com"&gt;incredible&lt;/A&gt; at Flash offered to help. This turned out to be a great experience for all of us, and the feedback has been tremendous.&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I'm very proud to share with&amp;nbsp;you (make sure your speakers are on)&amp;nbsp;&lt;A href="http://www.metalxmas.com/"&gt;&lt;B&gt;www.metalxmas.com&lt;/B&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;The code-behind&lt;BR&gt;&lt;/B&gt;I wanted to have a spot for friends, family, and haters to&amp;nbsp;post their honest ramblings, so&amp;nbsp;I decided to go with the much-loved JQuery/ASP.NET MVC combo; what a joy as always.&amp;nbsp; One bug I ran into, that seems to have been noticed before me, is the ability to cache the root page of your&amp;nbsp;ASP.NET MVC&amp;nbsp;site using&amp;nbsp;the OutputCache attribute.&amp;nbsp; According to &lt;A title="Post on stackoverflow" href="http://stackoverflow.com/questions/323458/aspnet-mvc-outputcache-doesnt-work-for-root-uri" target=_blank mce_href="http://stackoverflow.com/questions/323458/aspnet-mvc-outputcache-doesnt-work-for-root-uri"&gt;this thread&lt;/A&gt;, the mvc team will have a fix soon.&amp;nbsp; For the time-being, I ended up caching at the repository level by just sticking the data response from disk&amp;nbsp;into the HttpContext cache to ensure I only read&amp;nbsp;and parse my xml file every 10 seconds.&lt;BR&gt;&lt;BR&gt;Nothing else too interesting came up. I added&amp;nbsp;some spam protection, input validation (client and server-side), and HtmlEncoding to protect any hijacks.&amp;nbsp; All in all, another great experience.&amp;nbsp; I would share the code, &lt;A href="http://codebetter.com/blogs/karlseguin/archive/2008/12/15/oxite-oh-dear-lord-why.aspx" mce_href="http://codebetter.com/blogs/karlseguin/archive/2008/12/15/oxite-oh-dear-lord-why.aspx"&gt;but I&lt;/A&gt; have a certain&amp;nbsp;&lt;A href="http://blog.wekeroad.com/blog/some-thoughts-on-oxite/" target=_blank mce_href="http://blog.wekeroad.com/blog/some-thoughts-on-oxite/"&gt;Oxitephobia&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Scalability&lt;BR&gt;&lt;/B&gt;In the hopes (and&amp;nbsp;delusions of grandeur) of this thing being picked up as even a semi-viral hit.&amp;nbsp; I wanted to make sure the site wouldn't go down.&amp;nbsp; I placed the flash file, the&amp;nbsp;four mp3 files, the images, and the css file on a CDN.&amp;nbsp; I initially started with Amazon S3... but at 15cents/gig compared to SimpleCDN's 6cents/gig I had to switch.&amp;nbsp; I've been very happy with my experience, and they even include $15 worth of free credit when you first sign-up.&amp;nbsp; A friend of mine suggested I use the YSlow plugin to analyze my site; this ended up with the following configuration:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;HTTP Compression enabled on CDN (via url configuration) and IIS (c'mon, if you haven't done this yourself already, &lt;A title="Google search" href="http://letmegooglethatforyou.com/?q=IIS+gzip+compression" target=_blank mce_href="http://letmegooglethatforyou.com/?q=IIS+gzip+compression"&gt;DO IT NOW&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;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)&lt;/LI&gt;
&lt;LI&gt;JQuery and SWFObject scripts&amp;nbsp;hosted via google&lt;/LI&gt;
&lt;LI&gt;All scripts at the bottom&lt;/LI&gt;
&lt;LI&gt;XHTML 1.0 Strict validated by W3&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;This ended me with an &lt;B&gt;A&lt;/B&gt; score with YSlow.&amp;nbsp; I felt accomplished.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Parting thoughts&lt;BR&gt;&lt;/B&gt;I hope you enjoy it, it's definitely meant to be funny - so don't take it too seriously.&amp;nbsp; Feel free to pass it along to your friends and family!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6789309" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/dotjosh/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/dotjosh/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/dotjosh/archive/tags/JQuery/default.aspx">JQuery</category></item><item><title>Inheriting code (that smells)</title><link>http://weblogs.asp.net/dotjosh/archive/2007/12/14/inheriting-code-that-smells.aspx</link><pubDate>Fri, 14 Dec 2007 19:23:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5455560</guid><dc:creator>dotjosh</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/dotjosh/rsscomments.aspx?PostID=5455560</wfw:commentRss><comments>http://weblogs.asp.net/dotjosh/archive/2007/12/14/inheriting-code-that-smells.aspx#comments</comments><description>&lt;span style="font-weight: bold;"&gt;Josh&lt;/span&gt;: I am excited to be furthering the development of your tremendously popular website.&amp;nbsp; How may I gain access to the source control repository?&lt;br&gt;&lt;span style="font-weight: bold;"&gt;Customer&lt;/span&gt;: Give me a second... *You've got mail! - &lt;b&gt;sourcecode.zip&lt;/b&gt;*&lt;p&gt;Wow, this isn't my ideal way of getting my hands dirty in a project.&amp;nbsp; But, this will be easy to fix.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Opening this .NET 1.1 ASP.NET app, I find three projects and no solution file.&amp;nbsp; Confused, I open the projects individually and realize there is a huge circular reference issue that was circumvented by compiling the projects seperately and then referencing their output assemblies. Yuck. There are also heaps of bugs in the code causing all sorts of unneeded memory usage that's causing the application to freeze and recycle several times a day.&amp;nbsp; Finally, I'm told that all of the latest features created for the site have been causing problems everywhere else.&amp;nbsp; I think it's time for a change.&lt;br&gt;&lt;br&gt;After several weeks of &lt;a href="http://www.mbunit.com/" target="_blank" mce_href="http://www.mbunit.com/"&gt;unit tests&lt;/a&gt;, &lt;a href="http://www.jetbrains.com/resharper/" target="_blank" mce_href="http://www.jetbrains.com/resharper/"&gt;refactoring&lt;/a&gt;, &lt;a href="http://subversion.tigris.org/" target="_blank" mce_href="http://subversion.tigris.org/"&gt;SVN&lt;/a&gt;, and &lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET" target="_blank" mce_href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET"&gt;CC.NET&lt;/a&gt; configuration. &lt;/p&gt;&lt;ul&gt;&lt;li&gt;The site no longer crashes.&lt;br&gt;&lt;/li&gt;&lt;li&gt;Features can be implemented faster and more effectively.&lt;/li&gt;&lt;li&gt;Source control provides a source history with much safer storage.&lt;/li&gt;&lt;li&gt;A new version of the site can be deployed with the click of a button.&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&amp;nbsp;There is still a lot of work to be done.&amp;nbsp; But, I think this goes to show the power and reason for being agile.&amp;nbsp;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5455560" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/dotjosh/archive/tags/Legacy/default.aspx">Legacy</category><category domain="http://weblogs.asp.net/dotjosh/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item></channel></rss>