![]() ![]() The biggest problem I’ve encountered with the use of CDNs is for sites which have secure areas. There are a number of CDN providers around – Akamai, Amazon Cloud Front and Highwinds, to name but a few. In case you’re not aware, the idea is to farm off the hosting of static files onto a network of geographically distributed servers, and ensure that each user receives that content from the closest server to them. This isn’t something you can’t really address through configuration. ![]() If this is important to you, see the end of this post for a tool that can do it on the fly. Images are more tricky, and we’ve made the decision to not bother using CSS Sprites since most of the ways to do it are manual. private static void ConfigureStyleSheetIncludes( PageViewModel viewModel).private static void ConfigureJavaScriptIncludes( PageViewModel viewModel). ![]() To control which files are referenced in our views, we add the list of files to our base ViewModel class (from which all the other page ViewModels inherit) using conditional compilation statements. On my current project, we use the MSBuild task from that library to combine, minify and obfuscate JS and CSS as part of our release builds. CSS and JS combining and minification is pretty straightforward these days, especially with things like the Yahoo! UI Library: YUI Compressor for. You can do this by combining your CSS, Javascript and image files into single files. The second part of this is that all but the sparsest of pages can still be optimised by reducing the number of individual files downloaded. As I have learned from painful experience, having a conversation about slow page download times after you’ve implemented the fantastic designs that the client loved is not nice. Having well defined non-functional requirements up front, and ensuring that page designs are technically reviewed with those SLAs in mind is an important part of this. This is something that has to be addressed at an early stage in the design process – you need to ensure you balance up the need for a compelling and rich user experience against the requirements for fast download and page render times. Firstly and most obviously, the lighter your pages the faster the user can download them. The examples I’ve given are from my current project, which is built using ASP.NET MVC, the Spark View Engine and hosted on IIS7. Since I’ve now done this twice, I thought it would be useful to document what I know about the subject. One of the common tools for checking that your web pages are optimised for delivery to the user is YSlow, which rates your pages against the Yahoo! best practices guide. On my last two projects, I’ve been involved in various bits of performance tweaking and testing. Note: This was originally posted on my old blog at the EMC Consulting Blogs site. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |