Among the finest to understand if it is a good or bad idea to utilize a php css file performance smart. I actually want to perform a php way of using variables.

By php css file I am talking about:

<?php header("Content-type: text/css"); ?>

What exactly are your ideas about this?

I do not think it's an awful idea, and I am presently doing the work for the reason that way. During my framework I dynamically concatenate two css groups in 2 separate files, the website primary CSSs (layout, forms, etc) plus some module specific ones when they is available. So, they may be cached individually. I additionally include some dynamic path inside using php vars.

This can be a bad idea, but only when you do not cache.

Around the server side, I expect that you are with a couple kind of global site-level variables, then building your CSS from that. Fine, just make certain that you simply save the file, invalidating it whenever it must change (say, from an SVN checkin).

In the client's perspective, you need to make sure that it does not need to download it on every page load. For your you will need to correctly set last-modified headers or perhaps an Etag.

Not a chance, it's not unheard of within the wild. The only real performance hit happens when you output the file dynamically, which may be mitigated easily with server-side (and client side) caching.