This is always a hot topic, so I thought it would be a good idea to start a thread with current best practices and also future wishlist/wants/enhancements that can help optimize DNN for speed.
Lets get a good list going and we can offer it as a sticky or a optimization guide to be included in the core distribution.
Here's a quick list of things from the top of my head in no particular order. Please feel free to add. I'll try to form some logical groupings once we have a list going.
Current Best Practices
1) Use HTTP Compression. This is by far the single best speed optimization you can do. IIS 6.0 compression is supposed to be the best if you have control access to the web server. I understand the default settings are not optimal, so make sure you have it set for dynamic compression and not just static compression. If you don't have control access to the web server, then the HTTP compression from Ben Lowery is a very close second. This will soon be a core DNN module (maybe it already is). You can find more information on how to integrate it into your portal from core team member Scott McCulloch (
http://www.smcculloch.net/Resources/Articles/tabid/213/articleType/ArticleView/articleId/46/EnablingHTTPCompressionforDotNetNuke.aspx)
2) Be sure the .dlls are compiled in Release mode and the web.config is set for debug="false"
3) Use caching. You may need to experiment to find out what works best. DNN has a portal level setting available in Admin->Site Settings and also at the module level in the Module Settings. I'm not exactly sure how they differ so perhaps the core team member that worked on this can offer more insight.
4) Database optimizations ?
5) Whitespace removal. It is possible to remove the whitespace from the rendered html using a regex expression. I believe there is a faurly cheap HTTP module available on snowcovered for this. If someone has a link, please post it. I have seen improvements of around 10-13% in the size. However, if you are using HTTP Compression, this effect is minimal. Some tests should be done to compare the speed reduciton from the reduced html to the slightly increased load on the processor for the regex expression.
6) Viewstate removal. It is possible to move the viewstate off the rendered html and store it on the server (in sesion, DB, file, etc.) I believe there are a few commerical HTTP modules available for this on snowcovered. Please post link if you have them.
7) Javascript and CSS optimization. A lot of the .js files have a bunch of whitespace in them. If you really want to squeeze every millisecond of performance out, you can edit these files and remove all the whitespace without affecting functionality. Just be aware that upgrading to future DNN version will overwrite your changes, so plan accordingly.
Future enhancements / wishlist
1) Provide a way for the "default" css files to not be linked. Currently, DNN automatically links a css file (~/portals/_default/default.css) at the beginning of every page. This file provides some default css values in case your chosen skin doesn't define them. The file itself is about 15kb. Most decent skins will overwrite the majority of these css values so it would be nice ot have the option of not linking it in the first place. In addition, DNN will also link another file at the end of the chain called portal.css. This file provides a way for the portal admin to override css settings without changing the skin's css. The file itself is simply a list of all the default DNN css classes with no actual values. It would be nice to not have to link it if its not being used.
2) Viewstate optimization. Much has already been done here and the issue will alleviated even more with ASP.NET v2. However, it would be worht going over the core controls again to make sure they are not using viewstate unnecessarily. Additionally, it would be nice if there were a core method for moving the viewstate off the rendered html and keeping it on the server similar to the commercial http modules already available.
3) Whitespace optimizations. It would be great if all the core .js and .css files were optimized for speed right out the box. Additionally, providing a core method for html whitespace reduction would be nice.
4) Database optimizations. I remember seeing some threads a while back that someone had run some SQL Server analyzer on their DNN and found a bunch of indexes and such that could be added for increased speed. Additionally, I have noticed some curious design choices such as the Log table using a nvarchar field as the primary key. It would be great to have a DB guru go over the database design and make sure everything is optimal.
Feel free to add more.