Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Sep 2007
    Posts
    329
    Plugin Contributions
    0

    Default Optimize Stylesheet

    have a question... Is there things that you can do to your stylesheet to optimize a sites performance? Does it make things faster to combine statements rather than having many multiple statements? Here's an example of what I'm trying to get across here...

    #something1, something2, something3{
    border-image 0;
    }
    or

    something1 {border-image 0;}
    something2 {border-image 0;}
    something3 {border-image 0;}
    which of these ways is the fastest?.... or does it even make a difference?
    Thanks for your time everyone...

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Optimize Stylesheet

    The first would be the fastest - but if you are having loading issues due to this it is time to seek a new host because this should not be your bottleneck.
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Sep 2007
    Posts
    329
    Plugin Contributions
    0

    Default Re: Optimize Stylesheet

    Quote Originally Posted by kobra View Post
    The first would be the fastest - but if you are having loading issues due to this it is time to seek a new host because this should not be your bottleneck.
    Thanks for the reply kobra,

    I have noticed in the last day or so my site seems to be loading on the slow side. I don't know if it's something that I did with the code (I work on the site a lot) or could it be my host.

    Could you maybe give me some help on the "weboptimzation" web site? I tested it there but the numbers don't mean anything to me because I don't know what's good or bad (where the numbers are concerned).

    Can you bring up my site and let me know if you think it's loading slowly? I would really appreciate it!

    thanks

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Optimize Stylesheet

    In your admin > config > logging > Display The Page Parse Time > set this to on and record the parse time when navigating your pages. If they are not averaging 2 seconds or less - preferably sub second then you do have issues.

    You are using IH2 so this should be optimized for the images even though there are many on the home page.
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Sep 2007
    Posts
    329
    Plugin Contributions
    0

    Default Re: Optimize Stylesheet

    Quote Originally Posted by kobra View Post
    In your admin > config > logging > Display The Page Parse Time > set this to on and record the parse time when navigating your pages. If they are not averaging 2 seconds or less - preferably sub second then you do have issues.

    You are using IH2 so this should be optimized for the images even though there are many on the home page.
    Thanks for pointing that out to me... I didn't know there was a log file for that. I did some page loads and here is what I got:

    10/11/2007 19:15:34 [0.093s] /biz/admin/configuration.php?gID=10&cID=245
    10/11/2007 19:16:04 - /biz/ (0.750s)
    10/11/2007 19:16:22 - /biz/index.php?main_page=index&cPath=30 (1.435s)
    10/11/2007 19:16:29 - /biz/index.php?main_page=index&cPath=30_21 (0.754s)
    10/11/2007 19:16:33 - /biz/ (0.660s)
    10/11/2007 19:16:34 - /biz/ (0.770s)
    10/11/2007 19:16:41 - /biz/index.php?main_page=product_info&products_id=642&zenid=5fd15414e5c0ebddf0c3c903e 32bee17 (0.528s)
    10/11/2007 19:16:49 - /biz/index.php?main_page=shopping_cart (0.678s)
    10/11/2007 19:17:15 - /biz/index.php?main_page=shopping_cart (0.470s)
    10/11/2007 19:17:22 - /biz/index.php?main_page=login (0.459s)
    10/11/2007 19:17:37 - /biz/ (0.588s)
    10/11/2007 19:17:45 - /biz/index.php?main_page=shopping_cart (0.485s)
    10/11/2007 19:17:46 - /biz/index.php?main_page=product_info&products_id=642&zenid=5fd15414e5c0ebddf0c3c903e 32bee17 (0.423s)
    10/11/2007 19:17:47 - /biz/ (0.871s)
    10/11/2007 19:17:47 - /biz/index.php?main_page=index&cPath=30 (0.447s)
    10/11/2007 19:17:50 - /biz/ (0.587s)
    10/11/2007 19:17:51 - /biz/index.php?main_page=index&cPath=30_18 (0.677s)
    10/11/2007 19:17:57 - /biz/index.php?main_page=index&cPath=30_18&sort=20a&page=2 (0.616s)
    10/11/2007 19:18:03 - /biz/ (0.587s)
    10/11/2007 19:18:09 - /biz/ (0.580s)
    so it looks like everything is not as bad as I thought it was. Only one entry over a second and most of them sub-seconds.

    Thanks for the tip about the log file and thanks for checking out my site's performance.

  6. #6
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Re: Optimize Stylesheet

    Try this:

    Code:
    <?php if(extension_loaded('zlib')){ob_start('ob_gzhandler');} header("Content-type: text/css"); ?>
    
    YOUR ENTIRE STYLESHEET GOES HERE
    
    <?php if(extension_loaded('zlib')){ob_end_flush();}?>
    ..and rename your stylesheet.css to stylesheet.css.php

    Thats it. And see a dramatic decrease in page load time. Should compress ATLEAST (not "UPTO") 70%.

    Edit: Ofcourse you need to change stylesheet.css to stylesheet.css.php in the head section.
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

  7. #7
    Join Date
    Sep 2007
    Posts
    329
    Plugin Contributions
    0

    Default Re: Optimize Stylesheet

    Quote Originally Posted by Nimbuz View Post
    Try this:

    Code:
    <?php if(extension_loaded('zlib')){ob_start('ob_gzhandler');} header("Content-type: text/css"); ?>
    
    YOUR ENTIRE STYLESHEET GOES HERE
    
    <?php if(extension_loaded('zlib')){ob_end_flush();}?>
    ..and rename your stylesheet.css to stylesheet.css.php

    Thats it. And see a dramatic decrease in page load time. Should compress ATLEAST (not "UPTO") 70%.

    Edit: Ofcourse you need to change stylesheet.css to stylesheet.css.php in the head section.
    Hi Nimbuz, I don't know enough about the code to know what file that code is in. Can you nudge me in a direction? And when you talk about the "head" section... are you talking about tpl_header.php?

    Sorry for the dumb questions... I'm still new at this.
    Thanks a lot!

    update: I think I might know what you are talking about now. Do I put the code at the top and bottom of my stylesheet.css then rename it to stylesheet.css.php?... I think that's what you are talking about... now all I need to know is what the "head" file is... I will start looking (smile)
    Last edited by crabdance; 11 Nov 2007 at 03:58 AM. Reason: update

  8. #8

    Default Re: Optimize Stylesheet

    Quote Originally Posted by Nimbuz View Post
    Try this:

    Code:
    <?php if(extension_loaded('zlib')){ob_start('ob_gzhandler');} header("Content-type: text/css"); ?>
    
    YOUR ENTIRE STYLESHEET GOES HERE
    
    <?php if(extension_loaded('zlib')){ob_end_flush();}?>
    ..and rename your stylesheet.css to stylesheet.css.php

    Thats it. And see a dramatic decrease in page load time. Should compress ATLEAST (not "UPTO") 70%.

    Edit: Ofcourse you need to change stylesheet.css to stylesheet.css.php in the head section.
    Hi Nimbuz, I was wondering if it would be any trouble for you to describe how one would put the stylesheet.css.php code in the header file. I attempted this, but could not figure how to set up stylesheet.css.php instead of stylesheet.css

    Thanks,

    ~Rain_

  9. #9
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Optimize Stylesheet

    Browsers cache css files quite well, so that really doesnt matter.

    To reduce sql queries, try the suggestion here:
    http://www.zen-cart.com/forum/showthread.php?t=83340 (around post 7 or so)

    To reduce page load time:
    Check your images size, should be less than 5k each.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  10. #10

    Default Re: Optimize Stylesheet

    Quote Originally Posted by yellow1912 View Post
    To reduce page load time:
    Check your images size, should be less than 5k each.
    Does this include the logo, or is the logo an exception that could run 15k for instance?

    Thank you very much, you are always quick to help out with the right answers.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v155 optimize database
    By mespe in forum General Questions
    Replies: 1
    Last Post: 21 Jul 2016, 10:35 PM
  2. optimize zen cart?
    By Duir in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 11 Mar 2009, 10:42 AM
  3. Optimize ZenCart in phpMyAdmin
    By acreativepage in forum General Questions
    Replies: 6
    Last Post: 28 Mar 2007, 11:12 PM
  4. Optimize Zencart?
    By poil11 in forum General Questions
    Replies: 5
    Last Post: 20 Mar 2007, 09:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg