Page 2 of 3

Re: Speed up your site.. lose {stylesheet}

Posted: Fri Apr 20, 2007 6:59 pm
by Vin
Hmm. What's your experience with css gzipping and older browsers?

Re: Speed up your site.. lose {stylesheet}

Posted: Sat Apr 21, 2007 1:24 am
by kermit
another tip (that i use here)...

if you have multiple sites that use the same stylesheet(s), you can refer the 'other' sites to the first one's stylesheets, either by putting the full url in the stylesheet link(s):




instead of just




OR
, call them through cmsms (lookup the full url in the html output source of the first site):




instead of {stylesheet}

you just need to remember which site's stylesheets are used so you know which one to edit later on. i have three cmsms sites that use the same stylesheets; used to use the second solution, but changed to external files and use the first one now for them.

note: the second solution doesn't do anything (to improve site performance) under windows/iis, as cmsms on that platform always (generates and) sends the stylesheets on each page view (doesn't send a 304:not modified if the generated stylesheet matches client browser cache like it does on apache)... use external files instead (they're faster anyway, on any platform).


also, if you don't want references to ./stylesheet.php clogging up & skewing stats like webalizer (it will be the most-accessed 'page' of a cmsms site), external stylesheets are a must.

and
remember, if you use yahoo yui css or scripts, you can link to them directly off yahoo's servers... which will cache, and (some) may even already be present in your visitor's browser cache from other sites they've been to.

Re: Speed up your site.. lose {stylesheet}

Posted: Sun Apr 22, 2007 1:44 pm
by henrik
Vin wrote: Hmm. What's your experience with css gzipping and older browsers?
They will only be gzipped if the browser supports it.

But I can't imagine, that it is really faster. If you have small css files, their submission makes out a very small part of the page load time.
If you zip them transmitting will not be much faster but an instance of PHP starts for each of the files.

Henrik

Re: Speed up your site.. lose {stylesheet}

Posted: Sun Apr 22, 2007 2:31 pm
by kermit
henrik wrote:
Vin wrote: Hmm. What's your experience with css gzipping and older browsers?
They will only be gzipped if the browser supports it.

But I can't imagine, that it is really faster. If you have small css files, their submission makes out a very small part of the page load time.
If you zip them transmitting will not be much faster but an instance of PHP starts for each of the files.
gzipped stylesheets wont be "faster" for most sites.. unless they're insanely huge...

Documents (1 file) 7 kb (31 kb uncompressed)
Objects (0 files)
Scripts (5 files) 6 kb (36 kb uncompressed)
Style Sheets (15 files) 23 kb (125 kb uncompressed)

i shoot for < 10k for stylesheets (most end up around 5-6k or less).... if you have large stylesheets with lots of comments, try running them through http://www.cleancss.com/index.php -- using the 'optimized' stylesheets on the site and keeping the formatted and commented ones on the local pc for later editing.

Re: Speed up your site.. lose {stylesheet}

Posted: Sun Apr 22, 2007 4:36 pm
by Vin
kermit wrote: i shoot for < 10k for stylesheets (most end up around 5-6k or less).... if you have large stylesheets with lots of comments, try running them through http://www.cleancss.com/index.php -- using the 'optimized' stylesheets on the site and keeping the formatted and commented ones on the local pc for later editing.
Thanks for the link. I tried optimizing stylesheet on my own (and with the help of my text editor for the inline compression); although the compression of cleancss was just 4.8% then, it's certainly better.
kermit wrote: Style Sheets (15 files) 23 kb (125 kb uncompressed)
15 files? What are they for? Alternative stylesheets, print stylesheets? Aren't there too many?

Re: Speed up your site.. lose {stylesheet}

Posted: Mon Apr 23, 2007 2:05 am
by JohnnyB
Vin wrote: Hmm. What's your experience with css gzipping and older browsers?
I don't have a lot of experience with it... But, I'm pretty sure the browser just asks if there is a compressed version and grabs it if it is available.

I think overall the less sql requests made and the less files requested from a html page is way the way to go regardless how much a css (or any file served) can be compressed.

Re: Speed up your site.. lose {stylesheet}

Posted: Mon Apr 23, 2007 4:32 am
by cyberman
mww wrote: I think overall the less sql requests made and the less files requested from a html page is way the way to go regardless how much a css (or any file served) can be compressed.
AdoDB (not lite) has an option too to compress communication between frontend and database server ...

Re: Speed up your site.. lose {stylesheet}

Posted: Mon Apr 23, 2007 12:26 pm
by Pierre M.
Hello everybody,
henrik wrote: They will only be gzipped if the browser supports it.

But I can't imagine, that it is really faster. If you have small css files, their submission makes out a very small part of the page load time.
If you zip them transmitting will not be much faster but an instance of PHP starts for each of the files.
Compression may help a transfer fit in network packets boundaries :
If the lowest maximum transfer unit (MTU) of the network from the server to the client is 1500 bytes, a 2k uncompressed stylesheet needs 2 packets (and packet ordering management, retransmission if failure etc). This is a network time cost. The same 2k fit in a single 1500 byte packet when compressed to 450 bytes. Whis the same compression ratio, a 6k stylesheet still fits in a single 1500 bytes packet.
Moreover, servers' cache can cache the compressed versions of the almost static stylesheets. So it doesn't take extra CPU on the server side after initial compression. As decompression is less CPU intensive, any browser CPU can do it easily on the client side. Static data compression is almost allways a win for broadcasting.
Pierre M.

Re: Speed up your site.. lose {stylesheet}

Posted: Mon Apr 23, 2007 6:05 pm
by styson
Pierre M. wrote: Hello everybody,
henrik wrote: They will only be gzipped if the browser supports it.

But I can't imagine, that it is really faster. If you have small css files, their submission makes out a very small part of the page load time.
If you zip them transmitting will not be much faster but an instance of PHP starts for each of the files.
Compression may help a transfer fit in network packets boundaries :
If the lowest maximum transfer unit (MTU) of the network from the server to the client is 1500 bytes, a 2k uncompressed stylesheet needs 2 packets (and packet ordering management, retransmission if failure etc). This is a network time cost. The same 2k fit in a single 1500 byte packet when compressed to 450 bytes. Whis the same compression ratio, a 6k stylesheet still fits in a single 1500 bytes packet.
Moreover, servers' cache can cache the compressed versions of the almost static stylesheets. So it doesn't take extra CPU on the server side after initial compression. As decompression is less CPU intensive, any browser CPU can do it easily on the client side. Static data compression is almost allways a win for broadcasting.
Pierre M.
Agreed.  enable apache's mod_deflate to compress everthing to the client.  For heavy sites or pages, this can significantly increase laod times.  It helps anyone on a dialup for sure, regardless of page size.  It does eat extra CPU cycles on the server.   

Re: Speed up your site.. lose {stylesheet}

Posted: Mon Apr 23, 2007 11:25 pm
by henrik
I just made a "real" plugin out of it :)
http://dev.cmsmadesimple.org/projects/static-css/

Regards,
Henrik

Re: Speed up your site.. lose {stylesheet}

Posted: Tue Apr 24, 2007 9:15 am
by Gregor
Henrik,

Tried this plugin, and I nearly got it working; the pictures in the header (placed there by the stylesheet), don't show up. the rest of the page is shown. I removed the plugin, in case you wanted to look. My site iswww.uisge-beatha.eu

Regards,
Gregor

Re: Speed up your site.. lose {stylesheet}

Posted: Tue Apr 24, 2007 12:17 pm
by Gregor
Walking through the hall, I suddenly thought it might have to do with the directory path. In my stylesheet it is:

Code: Select all

   background: url(uploads/images/logo_links1.gif) no-repeat 0 0px;
I replaced it with (don't know how to change color inside a code or quote, I placed a / before uploads):

Code: Select all

   background: url(/uploads/images/logo_links1.gif) no-repeat 0 0px;
Now it's working :)

Re: Speed up your site.. lose {stylesheet}

Posted: Tue Apr 24, 2007 3:30 pm
by Pierre M.
@styson & others : to prevent some CPU cycles being eaten you can enable mod_cache between the client and mod_deflate.
Pierre M.

Re: Speed up your site.. lose {stylesheet}

Posted: Wed Apr 25, 2007 4:29 pm
by Russ
At least on my 1.0.5 the 'ccontent' solution stops the internal 'Search' working? It goes no where if you try to search? Anybody else have this?

Russ

Re: Speed up your site.. lose {stylesheet}

Posted: Thu Apr 26, 2007 10:48 am
by Pierre M.
May be the results page should not be cacheable ?
Pierre M.