DotNetNuke 4.4 introduced a number of performance enhancements. Many of these enhancements required the creation of new overloads of some common methods and deprecation of the existing methods.
It is important for module developers, who wish their modules to take advantage of the new performance features to update their modules for performance.
There are a couple of methods specifically that should probably be looked at.
ModuleController.GetModule(moduleID, tabID)
This method which existed prior to 4.4 was replaced by an overload that has an extra parameter (ignoreCache). This parameter determines whether the module is fetched from the cache (ignoreCache = false) or the database (ignoreCache=true). The old method calls the new method with the setting ignoreCache = true - which means that the call always goes to the database.
The implementation was done this way so that the expected behaviour did not change. However, it measn that module developers who wish to use the cache should add the ignoreCache=false parameter to their calls.
ModulePermissionController.HasModulePermission(moduleID, permissionKey)
This method that existed prior to 4.4, enabled a Module Developer to determine whther a user had a specific Module Permission. As the module permissions are now cached by the TabID - this method cannot take advantage of the module permission cache. (Note: the ModulePermissionCache is a Dictionary - where the keys are the moduleID and the values are the permissions for the module - this dictionary is then stored in the cache using a key based on the TabID)
Thus, if your module calls this overload of HasModulePermission it will always make a call to the stored procedure GetModulePermissionsByModuleID, bypassing the cache, and any performance improvements You can fix this by using one of two overloads:
- HasModulePermission(moduleID, tabID, permissionKey) - this new overload adds the tabId to the parameter list so the module permissions collection can be looked up in the appropriate Dictionary in the cache
- HasModulePermission(modulepermissions, permissionKey) - this overload that existed prior to 4.4 passes the modulepermissions as a parameter. In PortalModuleBase, the ModuleConfiguration property has a reference to the ModulePermissions - as does any instance of the ModuleInfo object.
There are other methods, of course, that should be checked. 4.5 added Folder and FolderPermission caching. The simplest way to determine whether you need to upgrade your module is to open it in Visual Studio and look for "This method is Obsolete" syntax warnings.