In the last few weeks I have been busy trying to get the performance of our DNN based company website (www.xcess.nl) better. I was triggered by a tweet from Salaro with a reference to a blog on IIS settings to improve caching and performance in general. I was also triggered by the fact that there are issues in some cases with DNN 5.6.x, that will not allow to use http compression from the host setting.
As a reference, I used Google online PageSpeed (http://pagespeed.googlelabs.com) which can give you a figure on a 100 scale. Apart from the basic user experience about poor website speed, badly performing websites will get a penalty in the SEO ranking. I set the page speed of Umbraco.org as my target: this site has a 93 out of a 100. Really good.
The start
When I started, I measured a PageSpeed figure of 62 out of 100 for our website. So this was not very good (BTW I measured DNN to be 72 out of 100). I did a lot of reading about IIS7 settings, experimented with various settings in IIS and tried several tools for image optimization. During a week I spend some time on and off. The main things I finally changed were:
- Enabling dynamic content compression (IIS Setting)
- Set .NET framework 4 for the application pool (IIS setting)
- HTTP response headers: Expire web content after 7 days (IIS setting)
- Enable output caching for .css, .gif, .jpg, .js and .png files (IIS setting)
- Use hosted jQuery (DNN Host setting)
- Minimize the images used on the pages (the right compression level, exact sizing for display)
After al this, I achieved a PageSpeed of 90 out of 100. Our website is really more responsive, reacts quicker, loads faster.
Please note that these settings will generate more workload onto the webserver, and if you have a tight, small, low resource webserver, these changes might not give a result as good as mine, or might even make things worse…
There was more
PageSpeed can give you advise what to improve. I already covered the high priority things with the above changes. So I started with the lower priority stuff, which included minifying .js and .css files. Mostly, these files contain a lot of “air”: new lines, spaces, indents, tabs, comments that make the source more readable for the human eye, but also make them bigger in file size. And although .js and .css files are text and compress well with the IIS content compression set to ON, less is more in these cases.
I manually minified the most important (as to the advise of PageSpeed) .js and .css files, which included several DNN core files. I tried various tools to do this, both command line as well as on-line tools. If you want to do the same, just Google on “compressing JavaScript” or “compressing CSS” and you will find a lot of references. Most routines will give you .css and .js files that are about 30-75% of the original size. Less is more!
Back to Google PageSpeed: yep, I have done it, I reached a PageSpeed of 94 out of 100! I have beaten Umbraco.org (on PageSpeed that is).
Did upgrade to DNN 5.6.2 help or not?
Our site was still running with DNN 5.6.1, so I decided to upgrade it to DNN 5.6.2 to see if that would improve it a bit more. But oh oh oh, I forgot that I compressed several .js and .css files form the DNN core. Due to the upgrade to 5.6.2 I lost my manual compression work. Grr...
Well, people who do not think well enough, have to work harder. So I repeated all minifying and compression work on several core .js and .css files. And I am back at 94 out of 100. The upgrade to DNN 5.6.2. did not improve that, but also did not make it worse.
There is still things left: JavaScript deferred loading
I did not touch a medium priority advise: deferred loading of .js libraries. I did not have the time to analyse every .js library loaded to see if this can be changed into deferred loading. I also do not have access to every part of each module to influence this. My assumption is that using .js deferred loading will improve DNN site performance even more and that It can beat my current 94 out of 100 if this is covered as well. So DNN and module developers: please have a look at deferred loading of .js libraries…
Conclusion: DNN production sites can have a structural better performance
DNN sites can be made much quicker. A number of the improvements can come from IIS, since in my opinion the default settings for IIS for a site focus on limiting resource usage, and not on site performance. You can change these settings for the benefit of your production sites,. If you give a DNN site even more attention and focus on compressing and minifying things, performance can become even much better. And these one time improvements work for every page hit, your work multiplies itself to the benefit of the site visitor as well as search engines. It is a win-win.