How to Optimize DotNetNuke speed by improving page load, caching and use of CDN

This is a real example of what can be done to get your sites running faster before upgrading the hardware.
Starting point – this blog mattjura.com with following specification: Server: Microsoft Windows NT 6.1.7601 Service Pack 1, IIS/7.5, .Net 4.0 and SQL Server 2008 R2 Express edition, 2GB RAM, 1GHZ CPU – running multiple sites. DotNetNuke

Stats before optimisation

  • WebPageTest.org results: Load time: 5.546s, First byte 1.491s, Start render 3.675s, Requests 66,
  • YSlow results: Overall performance score 70 Grade C
    The page has a total of 46 components and a total weight of 558.8K bytes
    Primed cache: HTTP Requests – 4, Total Weight – 56.2K
  • Google Page Speed results:
    Page Speed Score of 54 (out of 100)
    Not a good set of results but here are the steps to get the site running faster.

hflnet54

Server configuration – actions to complete

Enable content compression in: IIS Manager >> Compression
Add HTTP response headers in: IIS Manager >> HTTP response headers
(Enable HTTP keep alive and Expire web content after 7 days or as required)
Enable output caching in: IIS Manager >> Output Caching for the following file extensions .css, .gif, .jpg, .js and .png files (User-mode caching, using file change notifications)
This may not always be possible on the shared servers but if you do not ask you do not get.

DNN upgrade and configuration

Upgrade the site 6.02.05 >> 7.00.05 >> 7.03.04 (latest version)
Change the following settings in host >> host settings:
Basic settings – turn off copyright credits
Performance settings – cache setting heavy
Authenticated cacheability – Public
Client resource management – Enable Composite Files
Client resource management – Minify CSS
Client resource management – Minify JS
Scheduler mode – Timer Method
Enable Event Log Buffer – on
Auto sync file system – off
In Admin >> Site Settings turn off Enable Skin Widgets if not used

OK – getting better but still room for improvement.

Use Content Delivery Network

A CDN service will take all of your images, java script, and CSS (Cascading Style Sheets) and host them on to their network to quickly load them on your visitors browsers. Another benefit is that a CDN usually has a huge network of servers that are closer to your potential visitor ensuring that your site will load quickly wherever in the world they are visiting.
It has its drawback as you have to change your DNS settings to one supplied by CloudFlare however the process is very simple and takes 5 minutes. If your site has google ads or third party content you should try the rocket optimiser – free on all plans. Please check your site works as normal with rocket optimizer as it is still in beta at the time of writing this post.

Images, CSS, HTML

First to optimise the images, css files, and the code, implement sprites, optimise fav icon, replace deprecated menu.

How much has the speed of the site improved

  • WebPageTest results: 
    Load time improvement from 5.546 to 2.361 seconds
    Start render improvement from 3.675 to 1.230 seconds
  • YSlow results: 
    Grade improvement from Grade C & score 70 to Grade A & score 95
    Improvement from 46 components and a total weight of 558.8K bytes to 20 components and a total weight of 217.4K bytes
  • Google Page Speed
    Improvement from PageSpeed 54 to PageSpeed 88