Results 1 to 10 of 14

Hybrid View

  1. #1

    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_

  2. #2
    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

  3. #3

    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.

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

    Default Re: Optimize Stylesheet

    Does this include the logo
    '
    Logo is an image called through the file system and not normally via the stylesheet
    Zen-Venom Get Bitten

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

    Default Re: Optimize Stylesheet

    Quote Originally Posted by kobra View Post
    '
    Logo is an image called through the file system and not normally via the stylesheet
    Doesnt really matter if it is called thru file system or stylesheet, really.
    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

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

    Default Re: Optimize Stylesheet

    I thought that this was in reference to Nimbuz's suggestion of moving the stylesheet to php
    Zen-Venom Get Bitten

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

    Default Re: Optimize Stylesheet

    We want to make the whole page less than 100k if possible, so that includes everything from pictures to html, css, javascript etc...

    However, browsers cache css files quite well, so the css files are reloaded only once in a while(and they are re-used thru out the site). Logo is loaded once, there is a problem with the product pictures on main page though: products appear randomly, so even if some are cached, the next time users reload the page they will have to load new ones. So you want to make sure product images are well optimized.

    Also, your server should be well optimized as well. For instance, it happened to me once when I installed a ticket system called otrs which has cronjobs run every 15mins or so, and it slow down my server a lot. So make sure you are aware of that. And then if you use CPanel, it automatically runs updates and backup at 1am or so, which is still peak time on some servers (like mine), so I had to set it to 3-4am.
    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

 

 

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