[theme-reviewers] File operations in themes, which PHP functions are/will stay allowed?

Otto otto at ottodestruct.com
Wed Apr 6 23:23:39 UTC 2011


Just wanted to point out that Google's own mod_pagespeed system does
this sort of thing too:

http://code.google.com/speed/page-speed/docs/filter-css-inline.html

Small amounts of CSS code that probably changes often works better
when it's inline to the page itself. The overhead of an extra HTTP
request is larger than putting an extra K or so of code into the page
itself.

-Otto



On Wed, Apr 6, 2011 at 5:14 PM, Lmm Muc <lmmmuc at gmail.com> wrote:
> Thanks, Otto
>
>
> On Tue, Apr 5, 2011 at 4:51 AM, Otto <otto at ottodestruct.com> wrote:
>>
>> 2. For any normal kind of theme, you probably don't have that much
>> dynamic CSS that you actually need to create. You probably only have a
>> few settings, for things like colors, fonts, etc. No more than 1K of
>> code, probably. The dynamic CSS should go *inline* in the page itself.
>> Minified, if you prefer.
>>
>> Look at how the custom_background and custom_header stuff in core
>> works. It's creating CSS and then inserting it right into the page
>> using the wp_head hook. That's the right way to do dynamic CSS. Not
>> only does it avoid the whole writing files problem, but it also avoids
>> an extra HTTP round trip to the server to get your dynamically-written
>> static, but small, CSS file. It's actually faster and simpler to put
>> the dynamic CSS inline on the page itself.
>>
>> -Otto
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>


More information about the theme-reviewers mailing list