CSS Optimisations on WP_Styles (Was: [wp-hackers] WP
ThemeDirectory Submission Restrictions)
Mike Schinkel
mikeschinkel at gmail.com
Tue Oct 7 07:07:29 GMT 2008
> Ah yes, Well.. It could be done on a per-page basis,
> But that would remove nearly all gains that'd be
> achieved, The time it takes for WP to load server side,
> combine all the scripts together, etc, is about the
> same time that it'd take for any decent web server to
> serve up half a dozen static files, and the client
> should see no speed decrease thanks to HTTP Keepalives
> and Static compression at the server level.
You are presuming it would not be cached on a per page basis, and I assumed
it would be cached.
> In the end, I feel it comes down to Server speed,
> Serving static files is FAST, loading PHP and WordPress
> in comparison, is SLOW, The ammount of ms. saved by
> bundling all the page requests into a single request
> tends to be lost when it comes ot loading everything..
For point of clarity nothing I was suggesting would preclude static files,
they would just be cached and loaded by PHP.
Additionally, as "High Performance Web Sites"
(http://oreilly.com/catalog/9780596529307/) points out time spent in server
side PHP pages is rarely ever a bottleneck compared to the time it takes to
get to the browser and the overhead created by lots of HTTP requests. The
milliseconds lost by calling a PHP file that loads cached CSS based from a
static file named based on the URL of the page that requests it from the
file system would be unnoticable for all but probably the largest 0.1% of
WordPress sites. It would be an almost perfect solution. IMO.
And if someone were really optimistic then using the PHP output buffer the
HTML could be captured, the CSS references rewritten and the resultant HTML
similarly cached which would probably greatly improve performance all
around, albeit that would be a much bigger project.
Anyway, this will be my last comment on this topic. I was just offering a
point of view I hadn't seen discussed but I hadn't intended to get into a
debate black hole. One has to choose his battles and this issue isn't the
battle I care to invest heavily in. FWIW.
-Mike Schinkel
http://mikeschinkel.com
More information about the wp-hackers
mailing list