Dnn performance optimization solution series (1) Overview

Source: Internet
Author: User
Tags dnn

Dnn4.5.5 should have done a lot of work in terms of performance. The above hostsetting Page's performance settings are not available in dnn3x (at least in 4.3.5 I am familiar.

1. page state persistence. I don't know how to translate it, but I know what it does. the viewstate of the page is saved to the page or memory. if the page is selected, the default Asp.net method is saved to the page. If the memory is selected, it is saved to the memory. we will find that
<Input type = "hidden" name = "_ viewstate" id ="
_ Viewstate "value =" "/>
That is to say, the viewstate of the page is empty.

2. Module cache method (not viewed yetCodeImplementation, to be learned, and later)

3. Run settings
Modulecontroller. VB

Public   Function gettabmodules () Function Gettabmodules ( Byval Tabid As   Integer ) As Dictionary ( Integer , Moduleinfo)
Dim Key As   String   =   String . Format (datacache. tabmodulecachekey, Tabid)

' First check the tab Cache
Dim Modules As Dictionary ( Integer , Moduleinfo) = Trycast (datacache. getpersistentcacheitem (key, GetType (Dictionary ( Integer , Moduleinfo), Dictionary ( Integer , Moduleinfo ))

If Modules Is   Nothing   Then
' Tabmodule caching settings
Dim Timeout As Int32 = Datacache. tabmodulecachetimeout * Convert. toint32 (common. globals. performancesetting)

' Get modules form database
Modules = Fillmoduleinfodictionary (dataprovider. instance (). gettabmodules (Tabid ))

' Cache tabs
If Timeout >   0   Then
Datacache. setcache (Key, modules, timespan. fromminutes (timeout ), True )
End   If
End   If
Return Modules
End Function

Tabcontroller. VB

Public   Function gettabsbyportal () Function Gettabsbyportal ( Byval Portalid As   Integer ) As Dictionary ( Integer , Tabinfo)
Dim Key As   String   =   String . Format (datacache. tabcachekey, portalid)

' First check the tab Cache
Dim Tabs As Dictionary ( Integer , Tabinfo) = Trycast (datacache. getpersistentcacheitem (key, GetType (Dictionary ( Integer , Tabinfo), Dictionary ( Integer , Tabinfo ))

If Tabs Is   Nothing   Then
' Tab caching settings
Dim Timeout As Int32 = Datacache. tabcachetimeout * Convert. toint32 (common. globals. performancesetting)

' Get tabs form database
Tabs = Filltabinfodictionary (dataprovider. instance (). gettabs (portalid ))

' Cache tabs
If Timeout >   0   Then
Datacache. setcache (Key, tabs, timespan. fromminutes (timeout ), True )
End   If
End   If

Return Tabs
End Function

4. Authorized Cache
File: dotnetnuke_04.05.05_source \ website \ default. aspx. VB

If Request. isauthenticated =   True   Then
' Set Client Side page caching for Authenticated Users
If Convert. tostring (portalsettings. hostsettings ( " Authenticatedcacheability " )) <>   ""   Then
Select   Case Convert. tostring (portalsettings. hostsettings ( " Authenticatedcacheability " ))
Case   " 0 " : Response. cache. setcacheability (httpcacheability. nocache)
Case   " 1 " : Response. cache. setcacheability (httpcacheability. Private)
Case   " 2 " : Response. cache. setcacheability (httpcacheability. Public)
Case   " 3 " : Response. cache. setcacheability (httpcacheability. Server)
Case   " 4 " : Response. cache. setcacheability (httpcacheability. serverandnocache)
Case   " 5 " : Response. cache. setcacheability (httpcacheability. serverandprivate)
End   Select
Else
Response. cache. setcacheability (httpcacheability. serverandnocache)
End   If
End   If

Why is the above source code set like this? I don't understand it. Please give me some advice.
Appendix 1 Asp.net Performance OptimizationArticle
Http://book.chinaz.com/net/asp.net1/dot15.htm

5. Compression setting: The compressionmodule built in dnn
<Let your dnn fly, super acceleration> http://www.cnreds.com/Default.aspx? Tabid = 60 & articles id = 185
Article MediumThe compressionmodule cannot be used normally in dnn4.5. The actual dnn has built in this function.

6. Use whitespace Filter.

We will introduce how to optimize the system in the previous sections.

PS: the ranking is 2000.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.