If a user is defining 30kb of custom CSS, then it&#39;s probably time to investigate use of a caching Plugin (most of which now also perform minification).<div><br></div><div>In the end, whatever marginal gains one might observe by writing to a file (and I tend to agree with Otto&#39;s statements below, that Method 1 is the most efficient), those marginal gains do not outweigh the other considerations regarding use of functions such as fopen().</div>
<div><br></div><div>Chip<br><br><div class="gmail_quote">On Wed, May 18, 2011 at 10:44 AM, Satish Gandham <span dir="ltr">&lt;<a href="mailto:satish.iitg@gmail.com">satish.iitg@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I followed the discussion on use of open that happened before,and read this several times, <br><br><a href="http://lists.wordpress.org/pipermail/theme-reviewers/2010-December/003192.html" target="_blank">http://lists.wordpress.org/pipermail/theme-reviewers/2010-December/003192.html</a><br>

<br>I&#39;m not convinced whats suggested there as the best way is the best way.<br><br>-----<br><b><br></b><blockquote><b>Method 1: Insert the dynamic CSS directly into the HTML using the wp_head call.</b><br><br><b>Method 1 has the lowest server impact. When you make the call to get</b><br>

<b>the page, it creates the page and outputs all the dynamic stuff in one</b><br><b>shot. Some people find the CSS in the html to be aesthetically</b><br><b>displeasing, but the fact of the matter is that this is the fastest,</b><br>

<b>simplest, and best way to do it.</b><br></blockquote><br>How the server impact is the lowest? CSS has to be generated dynamically every time the page is loaded. Bandwidth is wasted as the CSS cannot be cached.<br><br>
If we go by method two described below, CSS is generated only when the theme options are changed and then its just loading the static file, that can be cached by the browser.<br>
<br>My theme allows user to customize every element of the site and some styles are loaded only when the user enables a particular option.<br><br>So, my dynamic CSS is around 30kb on average. <br><br>In what way the above method is the BEST?<br>

<br>When thousands are users are going to use my theme, I&#39;m willing to spend extra time to offer the best solution rather than some simple and quick solution.<br><b><br></b><blockquote><b>Method 2: Write dynamic CSS to a file, link to the file in the head.</b><br>

<b>Method 2 has a problem in that you&#39;re doing file writing from the</b><br><b>theme. This is bad because you cannot guarantee that you have</b><br><b>permissions to even write files. Assuming you try to write them to the</b><br>

<b>uploads folder, then part of your theme is now outside the theme</b><br><b>directory, which is confusing. Also, by including the CSS as a</b><br><b>separate file, you&#39;re creating another call to the server, which even</b><br>

<b>Google Webmaster Tools will tell you is a thing to avoid.</b><br></blockquote><br>Whats wrong with having a theme file outside the theme folder?<br>What is confusing and Confusing to whom?<br><br>An extra http request if far better than adding 30kb of weight to every page. Also considering the number of images loaded by theme and the number of stylesheets loaded the by plugins, the ONE additional http request is insignificant.<br>

<br>Who told you they are confused? <br><br>There are 2500+ users on my theme support forum, and none of them ever had problems with the stylesheet located in uploads folder.<br><br>PS: I&#39;m pretty sure that I wont win this like all arguments, but I couldn&#39;t just put 100kb of CSS and javaScript on every page and waste the bandwidth of the blog owner and the reader.<br>

<br><br>Kind Regards<br><font color="#888888">Satish Gandham<br>
</font><br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br></div>