[wp-hackers] Adding A CSS Loader

Computer Guru computerguru at neosmart.net
Mon Apr 23 22:29:55 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Timo Kissing wrote:
> Computer Guru schrieb:
>> Chris wrote:
>>> Another point..
>>> Because CSS files are a cascade, would the order that plugins insert
>>> their CSS files potentially change the final CSS result?
>>> Chris
>> Technically, yes.
>> In reality, no.
> 
>> The reason is that if you had
> 
>> <link rel="stylesheet" href="mycss1.css" />
>> <link rel="stylesheet" href="mycss2_from_plugin.css" />
> 
>> it's the same as
> 
>> $css_text = get_file_contents("mycss1.css");
>> $css_text .= get_file_contents("mycss2_from_plugin.css");
> 
>> <link rel="stylesheet" href="dynamicstylesheet.php" />
> 
>> Order is still there and hasn't changed. Plus, the WP_Filter priority
>> thing would work great here too...
> 
> Except that the latter means 2 file IO operations for every request (1
> if you cache the result, but then you have overhead to find out if the
> cache is still up2date). And you will have to check for file dates too
> and set appropriate headers (mainly last modified) so the clients
> caching works.

How so?

The first is also two.

In the first sample there are 2 web streams + 2 IO streams.
In the second example there is 1 web stream + 2 IO streams.

Honestly, I don't think combined CSS is such a great idea.. I'm just
supporting it's benefits on paper, but real-world performance difference
would be close to zero 99.999999% of the time....

:D

- --
Computer Guru
NeoSmart Technologies
http://neosmart.net/blog/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGLTNj3SICh4XKUt0RAkDLAKDJQDP9f4MToapGbeIoHhWTKoP3WACgku3u
0xZ7IjXgTsQyDdM1ljFJDSw=
=kvjs
-----END PGP SIGNATURE-----


More information about the wp-hackers mailing list