Speed up your site.. lose {stylesheet}

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Vin

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

Post by Vin »

Hmm. What's your experience with css gzipping and older browsers?
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

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

Post 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.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
henrik

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

Post 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
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

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

Post 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.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Vin

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

Post 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?
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

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

Post 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.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
cyberman

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

Post 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 ...
Pierre M.

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

Post 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.
styson

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

Post 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.   
henrik

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

Post by henrik »

I just made a "real" plugin out of it :)
http://dev.cmsmadesimple.org/projects/static-css/

Regards,
Henrik
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

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

Post 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
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

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

Post 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 :)
Last edited by Gregor on Tue Apr 24, 2007 12:19 pm, edited 1 time in total.
Pierre M.

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

Post 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.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

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

Post 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
Pierre M.

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

Post by Pierre M. »

May be the results page should not be cacheable ?
Pierre M.
Post Reply

Return to “Tips and Tricks”