<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://britishinside.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Using updated CSS files</title><link>http://britishinside.com/archive/2007/07/11/Using-updated-CSS-files.aspx</link><description>Some browsers just don&amp;#39;t seem to &amp;quot;get&amp;quot; the idea behind shared files like CSS or Javascript files. For a while now I&amp;#39;ve been uploading updates to a web site and noticing that the browser continues to use the old version. That&amp;#39;s pretty</description><dc:language>en</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><item><title>re: Using updated CSS files</title><link>http://britishinside.com/archive/2007/07/11/Using-updated-CSS-files.aspx#11487</link><pubDate>Wed, 11 Jul 2007 21:58:42 GMT</pubDate><guid isPermaLink="false">6c0ed236-b916-4a20-a8ea-4a10abe198d6:11487</guid><dc:creator>Speednet</dc:creator><description>There is actually something you can do on the server, if you have access to IIS.

If you have a file that changes often, you can set the max-age header to a value of around an hour.  Most browsers respect that header.

Conversely, you can use that same header to EXTEND the amount of time that browsers will cache something.  (By setting the max-age header to a length of several days.)

To do this, go into the IIS Manager tool, drill down and highlight the file(s) or folder you want to set the header for, right-click and select Properties.  Then, switch to the HTTP Headers tab, and click the Add button in the Custom HTTP Headers section.  In the Custom header name, enter "Cache-Control" (no quotes).  In Customer Header Value, enter "max-age=3600" (no quotes) for one hour.  (max-age is seconds of cache time.)

It should do the trick!

-Todd ("Speednet")</description></item><item><title>re: Using updated CSS files</title><link>http://britishinside.com/archive/2007/07/11/Using-updated-CSS-files.aspx#11515</link><pubDate>Thu, 12 Jul 2007 12:14:42 GMT</pubDate><guid isPermaLink="false">6c0ed236-b916-4a20-a8ea-4a10abe198d6:11515</guid><dc:creator>Ryan Haney</dc:creator><description>If that header works via IIS, could you also use that with an HTTPHandler in ASP.NET?</description></item><item><title>re: Using updated CSS files</title><link>http://britishinside.com/archive/2007/07/11/Using-updated-CSS-files.aspx#11521</link><pubDate>Thu, 12 Jul 2007 13:41:44 GMT</pubDate><guid isPermaLink="false">6c0ed236-b916-4a20-a8ea-4a10abe198d6:11521</guid><dc:creator>James</dc:creator><description>&lt;p&gt;The trouble is, google will show you people who say that the header doesn't always help. It's either not supported or supported differently by various servers, proxies and browsers.&lt;/p&gt;
&lt;p&gt;Every little helps though I guess..&lt;/p&gt;
</description></item><item><title>re: Using updated CSS files</title><link>http://britishinside.com/archive/2007/07/11/Using-updated-CSS-files.aspx#11527</link><pubDate>Thu, 12 Jul 2007 14:55:52 GMT</pubDate><guid isPermaLink="false">6c0ed236-b916-4a20-a8ea-4a10abe198d6:11527</guid><dc:creator>Speednet</dc:creator><description>I wish I knew how to do line breaks.  I know this is going to run together - sorry in advance!

Ryan,

It's possible, although I have not tried it.  It's worth a shot.

James,

I agree that there is no silver bullet, but the reality I found in my testing (for a couple of years now) is that it works pretty well.  The most important thing is that it clears up 95% of the problems, because that's about the percentage of browsers in use today that it works with.  It's mostly older versions of secondary browsers that may not respect it, but there is no harm done to even those non-conforming browsers by adding the header.</description></item><item><title>re: Using updated CSS files</title><link>http://britishinside.com/archive/2007/07/11/Using-updated-CSS-files.aspx#11529</link><pubDate>Thu, 12 Jul 2007 14:57:30 GMT</pubDate><guid isPermaLink="false">6c0ed236-b916-4a20-a8ea-4a10abe198d6:11529</guid><dc:creator>Speednet</dc:creator><description>Also, James, your comment about proxies is a good point.  Some proxies will determine their own reality no matter what, but hopefully users who live behind such a proxy learn early on to refresh their cache often.</description></item><item><title>re: Using updated CSS files</title><link>http://britishinside.com/archive/2007/07/11/Using-updated-CSS-files.aspx#11535</link><pubDate>Thu, 12 Jul 2007 16:41:12 GMT</pubDate><guid isPermaLink="false">6c0ed236-b916-4a20-a8ea-4a10abe198d6:11535</guid><dc:creator>James</dc:creator><description>&lt;p&gt;Still, why does the problem exist today, even with IE7? &amp;nbsp;Hacking the caching will help - but if I'm demonstrating to the client and I've just uploaded the new CSS it won't help. I want to see *immediate* results, not &amp;quot;within the next hour&amp;quot;. :(&lt;/p&gt;
</description></item><item><title>re: Using updated CSS files</title><link>http://britishinside.com/archive/2007/07/11/Using-updated-CSS-files.aspx#11541</link><pubDate>Thu, 12 Jul 2007 17:46:42 GMT</pubDate><guid isPermaLink="false">6c0ed236-b916-4a20-a8ea-4a10abe198d6:11541</guid><dc:creator>Speednet</dc:creator><description>You CAN set up your client's browser to check for a new version of the support files every time.  It is in the Internet Options window.  BUT, most people do not want to do that, because it adds a lot more chatter, and slows things down on the client's end.  In the General tab, click the Settings button in the Browsing History section, then select "Every time I visit the webpage".</description></item></channel></rss>