Difference between revisions of "Cache Control"

From A-SMIL.org
Jump to: navigation, search
(Created page with 'A-SMIL features 2 methods , "systemCache" property and "cacheControl" parameter to manage player's playback behavior regarding to player's local cache status. ==systemCache== F...')
 
(cacheControl)
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
First is systemCache which is defining conditions whether a media item should be played based on the player's local cache.  
 
First is systemCache which is defining conditions whether a media item should be played based on the player's local cache.  
 +
 
Below example illustrates the usage and condition of systemCache.  
 
Below example illustrates the usage and condition of systemCache.  
  
Line 13: Line 14:
 
   <img src="http://foo.com/dummy1.jpg" dur="7s" />  <!-- play as expected -->
 
   <img src="http://foo.com/dummy1.jpg" dur="7s" />  <!-- play as expected -->
 
   <img src="http://foo.com/dummy2.jpg" dur="7s" />  <!-- player has no media to play , player wait 7 seconds to play next item -->
 
   <img src="http://foo.com/dummy2.jpg" dur="7s" />  <!-- player has no media to play , player wait 7 seconds to play next item -->
   <img src="http://foo.com/dummy3.jpg" dur="7s" systemCache="http://foo.com/dummy3.jpg" /> <!-- player has no media to play , player skipped and start next item playback immediately -->  
+
   <img src="http://foo.com/dummy3.jpg" dur="7s" systemCache="http://foo.com/dummy3.jpg" /> <!-- player has no media to play
 +
, player skip this playback and start next item playback immediately -->  
 
</seq>
 
</seq>
 
</source>
 
</source>
Line 46: Line 48:
 
   </img>   
 
   </img>   
 
   <img src="http://foo.com/dummy1.jpg" dur="7s">
 
   <img src="http://foo.com/dummy1.jpg" dur="7s">
  <param name="cacheControl" value="noCache"/>  <!-- Player download from server again and play, instead of playing from local cache -->
+
  <param name="cacheControl" value="noCache"/>  <!-- Player download from server again and play, instead of playing  
 +
from local cache -->
 
   </img>   
 
   </img>   
   <img src="http://foo.com/dummy2.jpg" dur="7s">  <!-- player has no local cache content to play from , player wait 7 seconds to play next item -->
+
   <img src="http://foo.com/dummy2.jpg" dur="7s">  <!-- player has no local cache content to play from , player wait 7 seconds
<param name="cacheControl" value="onlyIfCached"/>
+
to play next item -->
 +
  <param name="cacheControl" value="onlyIfCached"/>
 
   </img>
 
   </img>
 
   </seq>
 
   </seq>
 
</source>
 
</source>

Latest revision as of 10:34, 3 June 2013

A-SMIL features 2 methods , "systemCache" property and "cacheControl" parameter to manage player's playback behavior regarding to player's local cache status.

systemCache

First is systemCache which is defining conditions whether a media item should be played based on the player's local cache.

Below example illustrates the usage and condition of systemCache.

Precondition of this example - dummy1.jpg exists in player's local cache by previous successful download , instead dummy2.jpg and dummy3.jpg aren't avaialble from previous download.

<seq repeatCount="indefinite">
  <img src="http://foo.com/dummy1.jpg" dur="7s" />  <!-- play as expected -->
  <img src="http://foo.com/dummy2.jpg" dur="7s" />  <!-- player has no media to play , player wait 7 seconds to play next item -->
  <img src="http://foo.com/dummy3.jpg" dur="7s" systemCache="http://foo.com/dummy3.jpg" /> <!-- player has no media to play
 , player skip this playback and start next item playback immediately --> 
</seq>

cacheControl

CacheControl parameter is defining conditions regarding which copy to be played , whether from local cache or from server.

A-SMIL defines 3 different cacheControl behavior as below :

  • auto (default)

Play local cached content or stream from the server.

  • onlyIfCached

Content is played only if it is cached locally.

  • noCache

Content is always revalidated with origin server.

Below example illustrates the usage and condition of cacheControl parameter.

Precondition of this example - dummy1.jpg exists in player's local cache by previous successful download, instead dummy2.jpg is not available in cache from previous download.

<seq repeatCount="indefinite">
  <img src="http://foo.com/dummy1.jpg" dur="7s">    <!-- default is auto , player playback from local cache since content already cached -->
  </img>
  <img src="http://foo.com/dummy1.jpg" dur="7s">
	   <param name="cacheControl" value="auto"/>    <!-- player playback from local cache since content already cached -->
  </img>
  <img src="http://foo.com/dummy1.jpg" dur="7s">
	   <param name="cacheControl" value="onlyIfCached"/>  <!-- player playback from local cache since content already cached -->
  </img>  
  <img src="http://foo.com/dummy1.jpg" dur="7s">
	   <param name="cacheControl" value="noCache"/>  <!-- Player download from server again and play, instead of playing 
from local cache -->
  </img>  
  <img src="http://foo.com/dummy2.jpg" dur="7s">   <!-- player has no local cache content to play from , player wait 7 seconds
 to play next item -->
	   <param name="cacheControl" value="onlyIfCached"/>
  </img>
  </seq>