Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2005-12-21 14:30:30

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Web Optimization: Embedding CSS is better than linking?

It doesn’t make any differences.

Offline

#14 2005-12-21 14:40:53

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: Web Optimization: Embedding CSS is better than linking?

Yes. It doesn’t make a difference. But why is it present in the textpattern directory? There should be a reason for everything. no?


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#15 2005-12-21 16:21:20

NXArmada
Member
From: Sevierville, TN
Registered: 2005-09-13
Posts: 82

Re: Web Optimization: Embedding CSS is better than linking?

Maybe perhaps the devs wanted it there. You should ask them why but i think its kinda pointless. if u use .css files

Last edited by NXArmada (2005-12-21 16:23:25)


Ryan

Offline

#16 2005-12-21 16:37:42

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: Web Optimization: Embedding CSS is better than linking?

Why do you think css.php shouldn’t be in the Textpattern folder? You seem to think it’s obvious it should be in the root folder, but I don’t see why. Do you also think that the atom and rss generation files should be moved as well? The only externally facing php file is (and should be) index.php. A singler point of entry into the textpattern system seems reasonable to me.

Offline

#17 2005-12-21 17:05:43

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: Web Optimization: Embedding CSS is better than linking?

Alright. I know all this going off topic. Coz the original topic was about linking stylesheets. However I would like to continue the discussion about CSS.php and why it should be in the root.

I think CSS should be in the root directory or in its own directory. css.php is not an admin funciton, its a presentation function and it should be present in the root. I know it doesnt make a big difference. But I think its a cleaner and more aesthetic way of keeping presentational items. I dont want the textpattern directory as part of my css url structure. It has absolutely nothing to with admin functions. Similarly atom and rss generation should be from the root. I know this is a completely useless thing as far as function is concerned. Its more of aesthetics and the like.

I hope I was more clear this time.


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#18 2005-12-22 06:20:51

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Web Optimization: Embedding CSS is better than linking?

No comment on where it should or shouldn’t be, but I can tell you why it’s in the admin folder. I was investigating this for myself, just the other day.

A shortcut. One tag, <txp:css />, is dependant upon the file existing. Because of this, the file was added to a list of files for the diagnostics to check. The list of files are relative paths to the files from the textpattern directory, as opposed to relative to the site root path.

Offline

#19 2005-12-22 15:24:54

edburdo
Member
Registered: 2004-09-20
Posts: 79
Website

Re: Web Optimization: Embedding CSS is better than linking?

I use static linked CSS for my websites. Faster than the dynamic CSS from TXP. And since I don’t switch themes that often, I don’t get the benefit of the themes stuff.


Eric

Offline

#20 2006-01-31 04:58:55

TrustySmurf
New Member
Registered: 2004-09-25
Posts: 8

Re: Web Optimization: Embedding CSS is better than linking?

I’ve run Apache Bench against linked css as well as the default txp:css and found no real speed advantage either way. What DOES make a big difference is some form of caching.

FYI, my settings were as follows:
ab -n 1000 -c 100 http://pathToTextpattern
This was on a Mac (867mhz G4 cpu, 1gb RAM) running Apache 1.3.33, PHP 5.1.2 and MySQL(max) 4.1.14

I ran this 10 times per setup (at various times throughout the day) and the mean number of requests per second was about 30(+ or – 2) in all cases.

Interestingly, before installing a form of cache (asy_jpcache in this case… very nice Sencer), the mean was about 15 requests per second and before tweaking httpd.conf it was only 6 or 7!

So, for significantly faster Textpattern performance use some sort of caching and, assuming you have access to this, learn to optimize your apache conf file ( go here to begin learning: http://aplawrence.com/Web/apache_performance.html )

UPDATE
I was able to bump the mean number of requests per second up to 43(+ or – 2) simply by setting up an appropriate my.cnf file in the mysql data folder.

To summarize:
I started at 6 or 7 requests served per second.
Tweaked httpd.conf and moved to 15 per second.
Added Sencer’s asy_jpcache and went to 30 per second.
Created a basic mysql my.cnf file and went to 43 per second.
Sweeeeeeet. {;•~

Last edited by TrustySmurf (2006-02-01 02:02:48)

Offline

#21 2006-01-31 23:24:28

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Web Optimization: Embedding CSS is better than linking?

And to address an unanswered qustion in the first post, embedding the CSS in the HTML file for every page means that the browser has to download some of the same CSS repeatedly for every individual page rather than reusing a cached CSS file for the information.


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

Board footer

Powered by FluxBB