Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Controlling the module.css loading if not neededControlling the module.css loading if not needed
Previous
 
Next
New Post
6/7/2010 2:50 PM
 
Rodney Joyce wrote:
...yet if you put any view on a page the whole stylesheet is loaded by the core.

Is this a *real* problem or just theoretical?  I may be about to display staggering ignorance here.

I thought that the browser did a conditional request for the *.css files. So if the files have not changed then the browser only sucks them down on the first visit.  Do you really care after that?


Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
6/7/2010 3:30 PM
 
It's *real* problem, although a minor one ;) Basically with a few small changes in the core we can achieve small performance gains on all pages by reducing CSS that is never used. It's not going to crash or anything but the process is flawed - it's been around since DNN 1 and needs a revisit, especially now that Google ranking takes into account page speed...

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
6/7/2010 5:27 PM
 
Richard.

For each file the is mentioned on a webpage, the client must ask if there is a difference.  So even if there is no difference and the one from the cache can be used, the conversation must occur which takes time. 

Idealy, the fewer the number of files (css or js or whatever) the better.  So eliminating unwanted CSS file is a good thing -- or combining them in to a single file is good.  The goal is a page that is a single small file -- not going to happen, but it's the target.

So any options to improve or reduce the handling of CSS is a good thing. 
 
New Post
6/7/2010 7:34 PM
 
Yes, but how are we going to get Microsoft to combine all the ajax js files, and actually get them emitted with an expiry date on them instead of each being dynamically generated?

I've looked into the core code, here's the bit that does the module.css output:
' 1.try to load module.css from module folder
                    If File.Exists(Server.MapPath(Common.Globals.ApplicationPath & "/DesktopModules/" & folderName & "/module.css")) Then
                        objCSSCache(ID) = Common.Globals.ApplicationPath & "/DesktopModules/" & folderName & "/module.css"
                    Else
                        ' 2.otherwise try to load from Path to control
                        If controlSrc.ToLower.EndsWith(".ascx") Then
                            If File.Exists(Server.MapPath(Common.Globals.ApplicationPath & "/" & controlSrc.Substring(0, controlSrc.LastIndexOf("/") + 1)) & "module.css") Then
                                objCSSCache(ID) = Common.Globals.ApplicationPath & "/" & controlSrc.Substring(0, controlSrc.LastIndexOf("/") + 1) & "module.css"
                            End If
                        End If
                    End If

As you can see, there's really no way of changing or overriding this, because it is explicitly searching for the module.css file either in the module path, or in the same path as the .ascx file.  You could theoretically hack this process by locating each .ascx file that didn't need a common module.css into it's own directory (ie /admin/ for the admin files, /view/ for the 'view' modules) - as long as you don't include a module.css file in the root path of the desktopModules/modulename directory.  I might have a look further at this technique.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Controlling the module.css loading if not neededControlling the module.css loading if not needed


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out