<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using HTTP Headers to Serve Styles</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/feed/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it&#039;s largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<lastBuildDate>Tue, 11 Jun 2013 15:31:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Dev Blog AF83 &#187; Blog Archive &#187; Veille technologique (x2) : Annonces, Contenus, Conférences, Méthodes, Agilité, Développment, Langages, Editeurs, Outils, Bases de données, Protocoles, Bibliothèques, SEO, Ergonomie, etc.</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-444784</link>
		<dc:creator>Dev Blog AF83 &#187; Blog Archive &#187; Veille technologique (x2) : Annonces, Contenus, Conférences, Méthodes, Agilité, Développment, Langages, Editeurs, Outils, Bases de données, Protocoles, Bibliothèques, SEO, Ergonomie, etc.</dc:creator>
		<pubDate>Mon, 23 Feb 2009 19:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-444784</guid>
		<description><![CDATA[[...] http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/ : Eric Meyer propose d&#8217;utiliser les headers HTTP pour servir une balise style, afin de distinguer les serveurs de développement de ceux de production [...]]]></description>
		<content:encoded><![CDATA[<p>[...] <a href="http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/" rel="nofollow">http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/</a> : Eric Meyer propose d&#8217;utiliser les headers HTTP pour servir une balise style, afin de distinguer les serveurs de développement de ceux de production [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AMammenT</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-442103</link>
		<dc:creator>AMammenT</dc:creator>
		<pubDate>Wed, 11 Feb 2009 18:35:08 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-442103</guid>
		<description><![CDATA[This approach is really interesting.  I propose a slight variant below which should support any browser.  It continues to depend on Apache, but moves away from using HTTP headers to just serving the modified css using rewrite rules.  

1) Staging CSS:


@import &quot;public.css&quot;

html {background: url(staging-bg.png) 100% 50% repeat-y;}


2) Production.css:
@import &quot;public.css&quot;

3) Public.css: Style rules for the production environment

3) Use an Apache rewrite rule on staging servers to rewrite requests for production.css to requests for staging.css

This does cost an extra hop even in production, so it may not be optimal for production sites.  One way to address this would be to setup a rewrite rule in production that rewrites requests for production.css to public.css.  This saves the hop, but nothing breaks if the rule is omitted.]]></description>
		<content:encoded><![CDATA[<p>This approach is really interesting.  I propose a slight variant below which should support any browser.  It continues to depend on Apache, but moves away from using HTTP headers to just serving the modified css using rewrite rules.  </p>
<p>1) Staging CSS:</p>
<p>@import &#8220;public.css&#8221;</p>
<p>html {background: url(staging-bg.png) 100% 50% repeat-y;}</p>
<p>2) Production.css:<br />
@import &#8220;public.css&#8221;</p>
<p>3) Public.css: Style rules for the production environment</p>
<p>3) Use an Apache rewrite rule on staging servers to rewrite requests for production.css to requests for staging.css</p>
<p>This does cost an extra hop even in production, so it may not be optimal for production sites.  One way to address this would be to setup a rewrite rule in production that rewrites requests for production.css to public.css.  This saves the hop, but nothing breaks if the rule is omitted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Micheil</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-440786</link>
		<dc:creator>Micheil</dc:creator>
		<pubDate>Thu, 05 Feb 2009 14:49:33 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-440786</guid>
		<description><![CDATA[I do something sort of similar on a few websites I work on, where by I add SB or Staging to the page title, so I know what I&#039;m looking at.]]></description>
		<content:encoded><![CDATA[<p>I do something sort of similar on a few websites I work on, where by I add SB or Staging to the page title, so I know what I&#8217;m looking at.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max Design - standards based web design, development and training &#187; Some links for light reading (27/1/09)</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438689</link>
		<dc:creator>Max Design - standards based web design, development and training &#187; Some links for light reading (27/1/09)</dc:creator>
		<pubDate>Tue, 27 Jan 2009 10:56:42 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438689</guid>
		<description><![CDATA[[...] Using HTTP Headers to Serve Styles [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Using HTTP Headers to Serve Styles [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cris</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438639</link>
		<dc:creator>Cris</dc:creator>
		<pubDate>Mon, 26 Jan 2009 21:48:24 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438639</guid>
		<description><![CDATA[&lt;blockquote cite=&quot;#comment-438054&quot;&gt;Foolproof... until the .htaccess file accidentally migrates itself to the production server. :-)&lt;/blockquote&gt;
True, true. And to prevent that -- provided I have the privileges -- I would put the &#039;Header&#039; line in a &lt;Directory&gt; section of my apache configuration file (httpd.conf).
&lt;code&gt;
&lt;Directory /path/to/webroot&gt;
Header add Link &quot;&lt;/staging.css&gt;;rel=stylesheet;type=text/css;media=all&quot;
&lt;/Directory&gt;
&lt;/code&gt;

Now that the directive is safely stashed away from my development webroot, I&#039;ve further reduced the possibility of accidental migration. Or at least I&#039;ve passed the responsibility for it to my server admin ;)

By the way, how standard is it for Apache admins to enable mod_headers? I know my host has it, but I don&#039;t know if it&#039;s common practice.]]></description>
		<content:encoded><![CDATA[<blockquote cite="#comment-438054"><p>Foolproof&#8230; until the .htaccess file accidentally migrates itself to the production server. :-)</p></blockquote>
<p>True, true. And to prevent that &#8212; provided I have the privileges &#8212; I would put the &#8216;Header&#8217; line in a &lt;Directory&gt; section of my apache configuration file (httpd.conf).<br />
<code><br />
&lt;Directory /path/to/webroot&gt;<br />
Header add Link "&lt;/staging.css&gt;;rel=stylesheet;type=text/css;media=all"<br />
&lt;/Directory&gt;<br />
</code></p>
<p>Now that the directive is safely stashed away from my development webroot, I&#8217;ve further reduced the possibility of accidental migration. Or at least I&#8217;ve passed the responsibility for it to my server admin ;)</p>
<p>By the way, how standard is it for Apache admins to enable mod_headers? I know my host has it, but I don&#8217;t know if it&#8217;s common practice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: angela</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438505</link>
		<dc:creator>angela</dc:creator>
		<pubDate>Sun, 25 Jan 2009 16:41:46 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438505</guid>
		<description><![CDATA[Never thought about doing it like that - pretty interesting.  I&#039;ve never liked .htaccess though - not all servers have it enabled.  You can use a service like &lt;a href=&quot;http://www.httpviewer.net/&quot; rel=&quot;nofollow&quot;&gt;http header viewer&lt;/a&gt; to make sure that your trick is working]]></description>
		<content:encoded><![CDATA[<p>Never thought about doing it like that &#8211; pretty interesting.  I&#8217;ve never liked .htaccess though &#8211; not all servers have it enabled.  You can use a service like <a href="http://www.httpviewer.net/" rel="nofollow">http header viewer</a> to make sure that your trick is working</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Scholz</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438362</link>
		<dc:creator>Thomas Scholz</dc:creator>
		<pubDate>Sat, 24 Jan 2009 10:59:35 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438362</guid>
		<description><![CDATA[I add a parameter with the result of &lt;code&gt;filemtime()&lt;/code&gt; to my stylesheets. I just have to do the client side caching on my own side.]]></description>
		<content:encoded><![CDATA[<p>I add a parameter with the result of <code>filemtime()</code> to my stylesheets. I just have to do the client side caching on my own side.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timothy</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438300</link>
		<dc:creator>Timothy</dc:creator>
		<pubDate>Fri, 23 Jan 2009 21:40:24 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438300</guid>
		<description><![CDATA[Awesome. This helps a lot. Thank you!]]></description>
		<content:encoded><![CDATA[<p>Awesome. This helps a lot. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Holloway</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438255</link>
		<dc:creator>Peter Holloway</dc:creator>
		<pubDate>Fri, 23 Jan 2009 10:56:47 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438255</guid>
		<description><![CDATA[&quot;Try sprinkling in !important. Upload, reload, nothing.&quot; - I&#039;m glad it&#039;s not just me that does this ;)

We also use the coloured background idea to distinguish between test and production databases - just a bit of CSS in the database connection file does the trick.]]></description>
		<content:encoded><![CDATA[<p>&#8220;Try sprinkling in !important. Upload, reload, nothing.&#8221; &#8211; I&#8217;m glad it&#8217;s not just me that does this ;)</p>
<p>We also use the coloured background idea to distinguish between test and production databases &#8211; just a bit of CSS in the database connection file does the trick.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bramus!</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438252</link>
		<dc:creator>Bramus!</dc:creator>
		<pubDate>Fri, 23 Jan 2009 10:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438252</guid>
		<description><![CDATA[In the past I&#039;ve played with this &quot;problem&quot; too ... ended up coding a firefox extension that colors the location bar based on which URL you&#039;re at.

Only problems with my approach (and things I had coded quickly):
- it only worked on Firefox 2, Windows. Then Firefox 3 came out and I dropped the project
- no support for other browsers (IE, Safari, Opera, ...)

Great to see your approach on the subject ... and &lt;a href=&quot;http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438100&quot; rel=&quot;nofollow&quot;&gt;the posted PHP solution in the comments here&lt;/a&gt; is neat too!

Thanks,
B!]]></description>
		<content:encoded><![CDATA[<p>In the past I&#8217;ve played with this &#8220;problem&#8221; too &#8230; ended up coding a firefox extension that colors the location bar based on which URL you&#8217;re at.</p>
<p>Only problems with my approach (and things I had coded quickly):<br />
- it only worked on Firefox 2, Windows. Then Firefox 3 came out and I dropped the project<br />
- no support for other browsers (IE, Safari, Opera, &#8230;)</p>
<p>Great to see your approach on the subject &#8230; and <a href="http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438100" rel="nofollow">the posted PHP solution in the comments here</a> is neat too!</p>
<p>Thanks,<br />
B!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michiel van der Blonkq</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438223</link>
		<dc:creator>Michiel van der Blonkq</dc:creator>
		<pubDate>Fri, 23 Jan 2009 01:12:48 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438223</guid>
		<description><![CDATA[how about a solution to 

- an accidental quote char in the stylesheet, breaking it in FF, and

- background: url (image.jpg) no-repeat 0 0;

in that last one, check the space after url. In FF this works, in IE it breaks.

Well actually that background url problem I usually spot right away because I know it so well. The accidental quote was a really hard one recently, because I use an elegant font in my stylesheet editor (topstyle). The quote (`) was hardly visible.]]></description>
		<content:encoded><![CDATA[<p>how about a solution to </p>
<p>- an accidental quote char in the stylesheet, breaking it in FF, and</p>
<p>- background: url (image.jpg) no-repeat 0 0;</p>
<p>in that last one, check the space after url. In FF this works, in IE it breaks.</p>
<p>Well actually that background url problem I usually spot right away because I know it so well. The accidental quote was a really hard one recently, because I use an elegant font in my stylesheet editor (topstyle). The quote (`) was hardly visible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Wilson</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438216</link>
		<dc:creator>Peter Wilson</dc:creator>
		<pubDate>Fri, 23 Jan 2009 00:36:55 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438216</guid>
		<description><![CDATA[@&lt;a href=&quot;http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438176&quot; rel=&quot;nofollow&quot;&gt;Sherri&lt;/a&gt;

You can add custom headers is IIS too, &lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc753133.aspx&quot; title=&quot;Add custom HTTP response headers&quot; rel=&quot;nofollow&quot;&gt;details are on technet&lt;/a&gt;.]]></description>
		<content:encoded><![CDATA[<p>@<a href="http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438176" rel="nofollow">Sherri</a></p>
<p>You can add custom headers is IIS too, <a href="http://technet.microsoft.com/en-us/library/cc753133.aspx" title="Add custom HTTP response headers" rel="nofollow">details are on technet</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Buchanan</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438214</link>
		<dc:creator>Ben Buchanan</dc:creator>
		<pubDate>Fri, 23 Jan 2009 00:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438214</guid>
		<description><![CDATA[Great technique! Pity it&#039;s not supported by more browsers. Given that this only works in Firefox and Opera, you could also do this by running user stylesheets. It does mean everyone has to set it up, but you never have to worry about accidentally publishing it.]]></description>
		<content:encoded><![CDATA[<p>Great technique! Pity it&#8217;s not supported by more browsers. Given that this only works in Firefox and Opera, you could also do this by running user stylesheets. It does mean everyone has to set it up, but you never have to worry about accidentally publishing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Hogan</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438202</link>
		<dc:creator>Alan Hogan</dc:creator>
		<pubDate>Thu, 22 Jan 2009 23:30:46 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438202</guid>
		<description><![CDATA[Sample &lt;strong&gt;staging.css&lt;/strong&gt; (which &lt;a href=&quot;&quot; rel=&quot;nofollow&quot;&gt;looks like this&lt;/a&gt;): 
&lt;code&gt;
body::before {
	content: &#039;STAGING SITE&#039;;
	position: fixed;
	top: 3px;
	left: 3px;
	font-size: 16px;
	display: block;
	color: white;
	text-shadow: 0.1em 0.1em 0.3em black;
	-o-text-shadow: 0.1em 0.1em 0.3em black;
	-moz-text-shadow: 0.1em 0.1em 0.3em black;
	-webkit-text-shadow: 0.1em 0.1em 0.3em black;
	-ms-text-shadow: 0.1em 0.1em 0.3em black;
	opacity: 0.8;
	-moz-opacity: 0.8;
	-moz-opacity: 0.8;
	-o-opacity: 0.8;
	-ms-filter: &quot;progid:DXImageTransform.Microsoft.Alpha(Opacity=80)&quot;;
	z-index: 999;
}&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>Sample <strong>staging.css</strong> (which <a href="" rel="nofollow">looks like this</a>):<br />
<code><br />
body::before {<br />
	content: 'STAGING SITE';<br />
	position: fixed;<br />
	top: 3px;<br />
	left: 3px;<br />
	font-size: 16px;<br />
	display: block;<br />
	color: white;<br />
	text-shadow: 0.1em 0.1em 0.3em black;<br />
	-o-text-shadow: 0.1em 0.1em 0.3em black;<br />
	-moz-text-shadow: 0.1em 0.1em 0.3em black;<br />
	-webkit-text-shadow: 0.1em 0.1em 0.3em black;<br />
	-ms-text-shadow: 0.1em 0.1em 0.3em black;<br />
	opacity: 0.8;<br />
	-moz-opacity: 0.8;<br />
	-moz-opacity: 0.8;<br />
	-o-opacity: 0.8;<br />
	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";<br />
	z-index: 999;<br />
}</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sherri</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438176</link>
		<dc:creator>Sherri</dc:creator>
		<pubDate>Thu, 22 Jan 2009 21:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/?p=1010#comment-438176</guid>
		<description><![CDATA[Alas not everything is hosted on Apache...
I&#039;ll go look at the greasemonkey and stylish extensions to see if those work on IIS.]]></description>
		<content:encoded><![CDATA[<p>Alas not everything is hosted on Apache&#8230;<br />
I&#8217;ll go look at the greasemonkey and stylish extensions to see if those work on IIS.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->