<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>le blog &#187; xulrunner</title>
	<atom:link href="http://www.normyee.net/blog/category/xulrunner/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.normyee.net/blog</link>
	<description></description>
	<lastBuildDate>Wed, 09 Dec 2009 23:23:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Preventing xulrunner from caching browser files</title>
		<link>http://www.normyee.net/blog/2008/02/29/preventing-xulrunner-from-caching-browser-files/</link>
		<comments>http://www.normyee.net/blog/2008/02/29/preventing-xulrunner-from-caching-browser-files/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 18:43:48 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[webdev]]></category>
		<category><![CDATA[xulrunner]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/2008/02/29/preventing-xulrunner-from-caching-browser-files/</guid>
		<description><![CDATA[Leap day post! The xulrunner app I developed hits a web server running on localhost to serve up its main interface, via XUL&#8217;s &#60;browser&#62; tag (similar to HTML&#8217;s IFRAME tag). There are instances where the pages &#38; their dependencies should not be cached. Adding the various HTML &#60;meta&#62; tags (expires, pragma, cache-control) prevents the HTML]]></description>
			<content:encoded><![CDATA[<p>Leap day post!</p>
<p>The xulrunner app I developed hits a web server running on localhost to serve up its main interface, via XUL&#8217;s <a href="http://developer.mozilla.org/en/docs/XUL:browser" target="_blank">&lt;browser&gt;</a> tag (similar to HTML&#8217;s IFRAME tag). There are instances where the pages &amp; their dependencies should not be cached. Adding the various HTML &lt;meta&gt; tags (expires, pragma, cache-control) prevents the HTML pages from caching, but we really wanted to prevent .js files from being  cached since we change the content dynamically in some of them so we didn&#8217;t want to return stale data. If we were running <a href="http://httpd.apache.org" target="_blank">Apache</a>, we could just set some HTTP expires headers via <a href="http://httpd.apache.org/docs/2.2/mod/mod_expires.html" target="_blank">mod_expires</a> but since we needed to keep the app installer as small as possible, we were using a much more lightweight web server.</p>
<p>I first tried the following <a href="http://developer.mozilla.org/en/docs/Debugging_a_XULRunner_Application#Prefs" target="_blank">xul prefs</a>:</p>
<blockquote><p>pref(&#8220;nglayout.debug.disable_xul_cache&#8221;, true);<br />
pref(&#8220;nglayout.debug.disable_xul_fastload&#8221;, true);</p></blockquote>
<p>which didn&#8217;t work. I was seeing .js files being saved to xulrunner&#8217;s cache (on WinXP, it was in the C:\Documents and Settings\[User name]\Local Settings\Application Data\[App Vendor]\[App Name]\Profiles\* folder)</p>
<p>Then it dawned on me that since we were using the XUL &lt;browser&gt; tag, it essentially loads up a web browser to display the content. Since that meant it was essentially Firefox 2 loading up, I looked in Firefox&#8217;s about:config for caching-related preferences and voila:</p>
<blockquote><p>pref(&#8220;browser.cache.disk.enable&#8221;, false);</p></blockquote>
<p>I added that to xulrunner&#8217;s prefs.js &amp; no more caching</p>
]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2008/02/29/preventing-xulrunner-from-caching-browser-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
