<?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: An easy fix for unwanted CSS caching</title>
	<atom:link href="http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/</link>
	<description>The web site of Jesse Collicott</description>
	<lastBuildDate>Thu, 28 Jul 2011 02:16:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sam</title>
		<link>http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/comment-page-1/#comment-7564</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 09 Mar 2011 15:39:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/#comment-7564</guid>
		<description>With PHP, you could use the CSS file&#039;s modified datetime as the parameter and that only changes when the file is changed.
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css?&quot;/&gt;</description>
		<content:encoded><![CDATA[<p>With PHP, you could use the CSS file&#8217;s modified datetime as the parameter and that only changes when the file is changed.<br />
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css?&#8221;/&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Hayden</title>
		<link>http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/comment-page-1/#comment-51</link>
		<dc:creator>Stefan Hayden</dc:creator>
		<pubDate>Fri, 25 Aug 2006 15:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/#comment-51</guid>
		<description>Nate:

Calling time() in PHP would give a different variable every time. This would cause the CSS to reload on every page load.

The trick is to only have them reload the CSS when there is new code to display.</description>
		<content:encoded><![CDATA[<p>Nate:</p>
<p>Calling time() in PHP would give a different variable every time. This would cause the CSS to reload on every page load.</p>
<p>The trick is to only have them reload the CSS when there is new code to display.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate Cavanaugh</title>
		<link>http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/comment-page-1/#comment-42</link>
		<dc:creator>Nate Cavanaugh</dc:creator>
		<pubDate>Thu, 24 Aug 2006 18:02:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/#comment-42</guid>
		<description>True, though I don&#039;t think the users who have javascript turned off are very high (the highest I&#039;ve seen reported is about 10%, but I think more realistic is about 2-3% at the most).

If you&#039;re using php, you could just do it like this as well:

&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&lt;?php echo &#039;?&#039;.time(); ?&gt;&quot; /&gt;

but that only works on PHP pages.

Either way it saves it from having to do it manually :)</description>
		<content:encoded><![CDATA[<p>True, though I don&#8217;t think the users who have javascript turned off are very high (the highest I&#8217;ve seen reported is about 10%, but I think more realistic is about 2-3% at the most).</p>
<p>If you&#8217;re using php, you could just do it like this as well:</p>
<p>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;style.css&lt;?php echo &#8216;?&#8217;.time(); ?&gt;&#8221; /&gt;</p>
<p>but that only works on PHP pages.</p>
<p>Either way it saves it from having to do it manually <img src='http://www.collicott.net/jess/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jess</title>
		<link>http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/comment-page-1/#comment-31</link>
		<dc:creator>jess</dc:creator>
		<pubDate>Thu, 24 Aug 2006 01:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/#comment-31</guid>
		<description>Cool! That approach is more transparent in the code. The only downside would be users who have JavaScript disabled wouldn&#039;t get the benefit. But given the right scenarios, I do see benefits to approaching it this way.

Thanks Nate!</description>
		<content:encoded><![CDATA[<p>Cool! That approach is more transparent in the code. The only downside would be users who have JavaScript disabled wouldn&#8217;t get the benefit. But given the right scenarios, I do see benefits to approaching it this way.</p>
<p>Thanks Nate!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate Cavanaugh</title>
		<link>http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/comment-page-1/#comment-29</link>
		<dc:creator>Nate Cavanaugh</dc:creator>
		<pubDate>Wed, 23 Aug 2006 22:40:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.collicott.net/jess/2006/08/21/an-easy-fix-for-unwanted-css-caching/#comment-29</guid>
		<description>You could do this easily with a sprinkle of javascript.
I wrote a quick function object for you that you can run onload to turn off caching of css.

Give your link rel=&quot;...&quot;
an id such as &quot;the_stylesheet&quot; then include this code into your javascript:
var noCache = {
								init: function(){
									var neverCache = false;
									
									var ss = document.getElementById(&#039;the_stylesheet&#039;);
									if(!ss){return;}
									//this.neverCache = true;
									var time = new Date();
									var time = time.getTime();
									var freshCSS = ss.href+&#039;?&#039;+time;
									if(neverCache){
										return ss.href = freshCSS;
									}
									if(location.href.indexOf(&#039;cache=off&#039;) &gt; 0){
										ss.href = freshCSS;
									}
								}
							}

Then just add noCache.init(); to your onload handler.
						Basically, you can quickly turn off caching in the query string, by adding this: cache=off (eg http://your-domain.com/index.html?cache=off) 
or, you can set the var neverCache = false; to var neverCache = true; and that will make sure it is ALWAYS getting a fresh copy.

Just thought it might be helpful :)</description>
		<content:encoded><![CDATA[<p>You could do this easily with a sprinkle of javascript.<br />
I wrote a quick function object for you that you can run onload to turn off caching of css.</p>
<p>Give your link rel=&#8221;&#8230;&#8221;<br />
an id such as &#8220;the_stylesheet&#8221; then include this code into your javascript:<br />
var noCache = {<br />
								init: function(){<br />
									var neverCache = false;</p>
<p>									var ss = document.getElementById(&#8216;the_stylesheet&#8217;);<br />
									if(!ss){return;}<br />
									//this.neverCache = true;<br />
									var time = new Date();<br />
									var time = time.getTime();<br />
									var freshCSS = ss.href+&#8217;?'+time;<br />
									if(neverCache){<br />
										return ss.href = freshCSS;<br />
									}<br />
									if(location.href.indexOf(&#8216;cache=off&#8217;) &gt; 0){<br />
										ss.href = freshCSS;<br />
									}<br />
								}<br />
							}</p>
<p>Then just add noCache.init(); to your onload handler.<br />
						Basically, you can quickly turn off caching in the query string, by adding this: cache=off (eg <a href="http://your-domain.com/index.html?cache=off" rel="nofollow">http://your-domain.com/index.html?cache=off</a>)<br />
or, you can set the var neverCache = false; to var neverCache = true; and that will make sure it is ALWAYS getting a fresh copy.</p>
<p>Just thought it might be helpful <img src='http://www.collicott.net/jess/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

