0
Welcome Guest! Login
0 items Join Now

trimming the fat

    • rossanna j joseph's Avatar

    trimming the fat

    Posted 18 years 1 month ago
    • Hi,
      I am note using all the modules in the versatility template. Is it possible to disable some so that the size of the css and the loading speed could be improved. Thanks in advance.

      RJ
    • Bob Ateah's Avatar
    • Bob Ateah
    • Elite Rocketeer
    • Posts: 4521
    • Thanks: 0

    Re: trimming the fat

    Posted 18 years 1 month ago
    • If you would like some observations on how you can decrease the loading time (trim the fat) of your site, please post a URL if possible.
      You can try this site too:
      www.websiteoptimization.com/services/analyze/
    • The member formerly known as Roland Deschain
      After your question is solved, please Edit your original post and choose the Solved message icon, thank you!
    • Matthew's Avatar
    • Matthew
    • Hero Rocketeer
    • Posts: 299
    • Thanks: 0

    Re: trimming the fat

    Posted 18 years 1 month ago
    • For virtually all RT templates, once you have your site done, you can improve things right off the bat by combining .css files. The IE compatibility .css files have to be kept, but the style/color specific .css can be combined into the main .css, unless you want to allow your users to switch color schemes.

      Beyond that, there are a ton of tools that can help optimize your css.

      As for removing unused elements in your css, well, I wouldn't. The amount of savings that you get will be trivial (and after running an optimizer that strips out all the whitespace, it really won't be that much), and if you ever decide to add a module/feature/etc. back in, it will be a pain to fix.

      Reducing the total number of .css files will be the major savings there. After that, it is going to be the graphics that are loaded that really impact things.
    • www.gofftech.com Web Design
  • Re: trimming the fat

    Posted 18 years 1 month ago
    • How do you combine CSS files? I do not know much about this stuff but I would have thought in my naivity that you would just delete the CSS files that are not used, for example, if you use style 1 of 15, cant you just delete 2-15?
    • James Spencer / Developer & Support / Hull, UK
    • Matthew's Avatar
    • Matthew
    • Hero Rocketeer
    • Posts: 299
    • Thanks: 0

    Re: trimming the fat

    Posted 18 years 1 month ago
    • James S! wrote:
      How do you combine CSS files? I do not know much about this stuff but I would have thought in my naivity that you would just delete the CSS files that are not used, for example, if you use style 1 of 15, cant you just delete 2-15?

      There are several utilities that will actually combine .css files. Thus, if you are using style 1, for instance, you can actually combine it with the base template_css.css file, and then edit the index.php so that it won't even bother loading the style specific css. In this case, it saves one file load, which is pretty trivial, but if you have different css for modules (custom menus, etc.), then they can start to add up. I optimized a site for a customer a while back and was able to get them from almost 20 different .css files down to 3.

      I'd attach a link for the optimizers I know of, but I'm on site at a client's today, and don't have my bookmarks. Still, just google it, and you'll find plenty.
    • www.gofftech.com Web Design
  • Re: trimming the fat

    Posted 18 years 1 month ago
    • It's a good exercise to combine them by hand; you can learn a lot about the CSS you are using.

      Since the template_css.css has the layout elements and the color.css has the colors, they often each have a style tag for the exact same element. You can just combine them.

      Doing it by hand does take a while, though.

      I also find it beneficial to combine javascript files.
    • Matthew's Avatar
    • Matthew
    • Hero Rocketeer
    • Posts: 299
    • Thanks: 0

    Re: trimming the fat

    Posted 18 years 1 month ago
    • Christian Smith wrote:
      It's a good exercise to combine them by hand; you can learn a lot about the CSS you are using.

      Since the template_css.css has the layout elements and the color.css has the colors, they often each have a style tag for the exact same element. You can just combine them.

      Doing it by hand does take a while, though.

      I also find it beneficial to combine javascript files.

      Agreed, especially about the Javascript, which I totally forgot to even mention.

      Combining them by hand is not just educational, but the result is often more easy to maintain.

      Unfortunately, in this busy modern world of ours, I usually just leave a dev site with them seperate, and use automation to combine for the production site, as most of my customers are not willing to pay me a few more billable hours to hand optimize, and I don't feel like doing it for my health. :D

      On simple sites, I often don't even bother, although I should, but as they say, laziness is like unto Godliness. :D
    • www.gofftech.com Web Design
  • Re: trimming the fat

    Posted 18 years 1 month ago
    • Could you give an example of how to combine css? ie..a section of css ;D
    • James Spencer / Developer & Support / Hull, UK
    • Matthew's Avatar
    • Matthew
    • Hero Rocketeer
    • Posts: 299
    • Thanks: 0

    Re: trimming the fat

    Posted 18 years 1 month ago
    • Well, if the template_css.css of a template had something like this:

      div somedivname {
      width: 800px;
      }

      And style1.css had something like this:

      div somedivname {
      background: various background stuff;
      }

      Then to combine them, the template_css.css version would be changed to look like this:

      div somedivname {
      width: 800px;
      background: various background stuff;
      }

      If all such tags are combined, then style1.css can be deleted altogether.

      If a tag exists in style1.css that does not exist in template_css.css, then the whole tag can be transplanted.

      Just make sure to eliminate the line in index.php that loads the style specific css, because that file is no longer needed (and hopefully no longer even on the production site).
    • www.gofftech.com Web Design
  • Re: trimming the fat

    Posted 18 years 1 month ago
    • Thanks for that Matthew, ill have a try ;D
    • James Spencer / Developer & Support / Hull, UK

Time to create page: 0.060 seconds