<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Be in Charge of Browser Cacheing!</title>
	<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Tue, 06 Jan 2009 21:30:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-111555</link>
		<pubDate>Thu, 13 Dec 2007 18:40:08 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-111555</guid>
					<description>Jdaze,

Yes, you could certainly put your random number into the HTML, but then you'd have to use JavaScript to produce that random number, which means you'd also have to use JavaScript to write out that part of the HTML.  You could use the JavaScript &lt;code&gt;document.write()&lt;/code&gt; method or DOM scripting to do that, or &amp;#8212; since it's a good idea to use something like &lt;a href=&quot;http://blog.deconcept.com/swfobject/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;SWFObject&lt;/a&gt; anyway &amp;#8212; just use your JS-based Active Content workaround of choice to introduce the random number at that point (see my reply to Jeremy and Rich on &lt;a href=&quot;#comment-31739&quot;&gt;April 2, 2007&lt;/a&gt;).</description>
		<content:encoded><![CDATA[<p>Jdaze,</p>
<p>Yes, you could certainly put your random number into the HTML, but then you&#8217;d have to use JavaScript to produce that random number, which means you&#8217;d also have to use JavaScript to write out that part of the HTML.  You could use the JavaScript <code>document.write()</code> method or DOM scripting to do that, or &mdash; since it&#8217;s a good idea to use something like <a href="http://blog.deconcept.com/swfobject/" target="_blank" rel="nofollow">SWFObject</a> anyway &mdash; just use your JS-based Active Content workaround of choice to introduce the random number at that point (see my reply to Jeremy and Rich on <a href="#comment-31739">April 2, 2007</a>).
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jdaze</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-111507</link>
		<pubDate>Thu, 13 Dec 2007 15:39:29 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-111507</guid>
					<description>like so? Maybe the coding will show up this time...I hope

( param name=&quot;movie&quot; value=&quot;yourMovieHere.swf?rand=[random number]&quot; )
( embed src=&quot;yourMovieHere.swf?rand=[random number]&quot; )</description>
		<content:encoded><![CDATA[<p>like so? Maybe the coding will show up this time&#8230;I hope</p>
<p>( param name=&#8221;movie&#8221; value=&#8221;yourMovieHere.swf?rand=[random number]&#8221; )<br />
( embed src=&#8221;yourMovieHere.swf?rand=[random number]&#8221; )
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jdaze</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-111506</link>
		<pubDate>Thu, 13 Dec 2007 15:36:49 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-111506</guid>
					<description>Is it possible to have a random number generated here instead?


</description>
		<content:encoded><![CDATA[<p>Is it possible to have a random number generated here instead?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-91802</link>
		<pubDate>Thu, 18 Oct 2007 13:09:49 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-91802</guid>
					<description>Will,

That isn't something I've definitively tried to nail down.  Thinking back over my own experiences &amp;#8212; happenstance, where I would partially download a video and recompile, because I was testing something else &amp;#8212; I, too, would say I've had inconsistent results.  In my own endeavors, the default buffer time is usually adequate; the minor pause before the video starts has been fine.

If you goal is to avoid the pause, I believe your best bet is true streaming, by way of Flash Media Server, Red5, and the like.

Wish I had a handy answer for you!  :)</description>
		<content:encoded><![CDATA[<p>Will,</p>
<p>That isn&#8217;t something I&#8217;ve definitively tried to nail down.  Thinking back over my own experiences &mdash; happenstance, where I would partially download a video and recompile, because I was testing something else &mdash; I, too, would say I&#8217;ve had inconsistent results.  In my own endeavors, the default buffer time is usually adequate; the minor pause before the video starts has been fine.</p>
<p>If you goal is to avoid the pause, I believe your best bet is true streaming, by way of Flash Media Server, Red5, and the like.</p>
<p>Wish I had a handy answer for you!  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Will Streeter</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-91737</link>
		<pubDate>Thu, 18 Oct 2007 04:56:54 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-91737</guid>
					<description>Is it possible to cache a part of an flv. Thus, I wanted to precache 10% of an flv so that when I actually begin to play an FLV it will automatically load in 10 % of the flv from the browser.  

I have been trying with inconsitent results... 

any ideas?</description>
		<content:encoded><![CDATA[<p>Is it possible to cache a part of an flv. Thus, I wanted to precache 10% of an flv so that when I actually begin to play an FLV it will automatically load in 10 % of the flv from the browser.  </p>
<p>I have been trying with inconsitent results&#8230; </p>
<p>any ideas?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-81046</link>
		<pubDate>Thu, 13 Sep 2007 12:45:20 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-81046</guid>
					<description>JBlaze,

A compiler directive would be really nice for something like this, but the API provides a quick way to determine what mode you're in.  See the &lt;code&gt;System.capabilities&lt;/code&gt; class, which has a static &lt;code&gt;playerType&lt;/code&gt; property.  An &lt;code&gt;if&lt;/code&gt; statement is all you need:

&lt;pre&gt;&lt;code&gt;if (System.capabilities.playerType == &quot;External&quot;) {
  // this is the value for test movie mode
} else {
  // not in the IDE, so use cacheing workaround
}&lt;/code&gt;&lt;/pre&gt;

Of course, that doesn't provide a way to cause the hack to work locally, but it sounds like you're just looking for a way to turn it on or off depending on the circumstances.  (The funny thing is, I haven't noticed the technique to fail locally, but I don't currently run a server on my local machines.)</description>
		<content:encoded><![CDATA[<p>JBlaze,</p>
<p>A compiler directive would be really nice for something like this, but the API provides a quick way to determine what mode you&#8217;re in.  See the <code>System.capabilities</code> class, which has a static <code>playerType</code> property.  An <code>if</code> statement is all you need:</p>
<pre><code>if (System.capabilities.playerType == "External") {
  // this is the value for test movie mode
} else {
  // not in the IDE, so use cacheing workaround
}</code></pre>
<p>Of course, that doesn&#8217;t provide a way to cause the hack to work locally, but it sounds like you&#8217;re just looking for a way to turn it on or off depending on the circumstances.  (The funny thing is, I haven&#8217;t noticed the technique to fail locally, but I don&#8217;t currently run a server on my local machines.)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: JBlaze</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-80966</link>
		<pubDate>Thu, 13 Sep 2007 05:16:02 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-80966</guid>
					<description>The problem with this method as others have stated, is it doesn't work when using it on your local devbox.  As far as I can tell, in AS you can't have any kind of compiler directive to switch off this when running locally.  Any suggestions on managing running locally vs. running on the web?</description>
		<content:encoded><![CDATA[<p>The problem with this method as others have stated, is it doesn&#8217;t work when using it on your local devbox.  As far as I can tell, in AS you can&#8217;t have any kind of compiler directive to switch off this when running locally.  Any suggestions on managing running locally vs. running on the web?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-76646</link>
		<pubDate>Wed, 29 Aug 2007 11:41:37 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-76646</guid>
					<description>Shawn,

I think you're asking how to keep ActionScript (.as) files from cacheing, but that's not what AS files do &amp;#8212; in fact, they shouldn't be on the server at all.  The &lt;code&gt;#include&lt;/code&gt; directive in ActionScript is significantly different from the concept of includes in PHP or ASP.  In the latter, include files percolate to the pages that call them as soon as they're uploaded.  In ActionScript, code is compiled, or &quot;baked,&quot; into the SWF at compile time, at which point it becomes immutable.

I've seen many developers update the contents of an AS file, then upload that AS file to the server, hoping the SWF will look to the update and behave differently, but &lt;code&gt;#include&lt;/code&gt; &lt;em&gt;only&lt;/em&gt; works at compile time.  It literally copies/pastes the AS file's content into the FLA as if you had typed it there by hand ... only as the SWF is generated.  If you want to pull in data at runtime, you'll have to read the contents of a text file that stores name/value pairs in the same format as a query string, or read the contents of an XML file, or hit a database, etc.

Does that make sense?</description>
		<content:encoded><![CDATA[<p>Shawn,</p>
<p>I think you&#8217;re asking how to keep ActionScript (.as) files from cacheing, but that&#8217;s not what AS files do &mdash; in fact, they shouldn&#8217;t be on the server at all.  The <code>#include</code> directive in ActionScript is significantly different from the concept of includes in PHP or ASP.  In the latter, include files percolate to the pages that call them as soon as they&#8217;re uploaded.  In ActionScript, code is compiled, or &#8220;baked,&#8221; into the SWF at compile time, at which point it becomes immutable.</p>
<p>I&#8217;ve seen many developers update the contents of an AS file, then upload that AS file to the server, hoping the SWF will look to the update and behave differently, but <code>#include</code> <em>only</em> works at compile time.  It literally copies/pastes the AS file&#8217;s content into the FLA as if you had typed it there by hand &#8230; only as the SWF is generated.  If you want to pull in data at runtime, you&#8217;ll have to read the contents of a text file that stores name/value pairs in the same format as a query string, or read the contents of an XML file, or hit a database, etc.</p>
<p>Does that make sense?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Shawn Wilson</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-76489</link>
		<pubDate>Wed, 29 Aug 2007 00:05:39 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-76489</guid>
					<description>Any idea how to be in charge of caching included '.as' files?  I'm developing a file now, have cache set to 0Kb.  The query string trick won't work (malformed include error).  My movie has 2 text blocks named 'foo' and 'bar'.

My code in frame 1 (of 1) is:

&amp;#62; #include &quot;test.as&quot;
&amp;#62; bar.text = 'working';

test.as code is:

&amp;#62; foo.text = 'bar'; 

I run the movie and get 'bar' and 'working'.  Great.  I change test.as to:

&amp;#62; foo.text = 'bar2'; 

and I still get 'bar' and 'working'.  No amount of cache clearing or restarting will clear it up.

I think it'd make a great blog post if you can solve it.  The Google, she does nothing.

--Shawn</description>
		<content:encoded><![CDATA[<p>Any idea how to be in charge of caching included &#8216;.as&#8217; files?  I&#8217;m developing a file now, have cache set to 0Kb.  The query string trick won&#8217;t work (malformed include error).  My movie has 2 text blocks named &#8216;foo&#8217; and &#8216;bar&#8217;.</p>
<p>My code in frame 1 (of 1) is:</p>
<p>&gt; #include &#8220;test.as&#8221;<br />
&gt; bar.text = &#8216;working&#8217;;</p>
<p>test.as code is:</p>
<p>&gt; foo.text = &#8216;bar&#8217;; </p>
<p>I run the movie and get &#8216;bar&#8217; and &#8216;working&#8217;.  Great.  I change test.as to:</p>
<p>&gt; foo.text = &#8216;bar2&#8242;; </p>
<p>and I still get &#8216;bar&#8217; and &#8216;working&#8217;.  No amount of cache clearing or restarting will clear it up.</p>
<p>I think it&#8217;d make a great blog post if you can solve it.  The Google, she does nothing.</p>
<p>&#8211;Shawn
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-59843</link>
		<pubDate>Thu, 28 Jun 2007 03:49:47 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/be-in-charge-cacheing#comment-59843</guid>
					<description>suBi,

To add a random number to the HTML itself, you'll need to use JavaScript.  The least complicated way I can think of is to use an approach that already uses JavaScript to embed the SWF, such as Geoff Stearns' SWFObject.  Scroll up just a bit and see my reply to Jeremy and Rich (April 2, 2007) and you'll see an example.  :)</description>
		<content:encoded><![CDATA[<p>suBi,</p>
<p>To add a random number to the HTML itself, you&#8217;ll need to use JavaScript.  The least complicated way I can think of is to use an approach that already uses JavaScript to embed the SWF, such as Geoff Stearns&#8217; SWFObject.  Scroll up just a bit and see my reply to Jeremy and Rich (April 2, 2007) and you&#8217;ll see an example.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
