Media files are loaded “on-the-fly” when they are needed for the first time. When downloaded, they are kept in the cache storage. When the storage runs out, the last used files are deleted first. How to ensure, that the file will play only if it is cached?
The SMIL prefetch introduce a preload mechanism. Prefetch loads a media into cache without playing it.
But we have also some more control over the caching.
Control the Cache Behavior
A parameter with the name cacheControl and a value control how the cache works. This is not standard SMIL, but useful. Player who not supported this feature should ignore it.Values are:
- noCache: This means the player will download the media every time.
- onlyIfCached: The media will not displayed until it is completely downloaded in the cache storage. Some player will skip, if media is not in cache, even when a dur-attribute has a value.
- auto: This is default and the same as onlyIfCached
Websites, streams, and colors (brush) will not be cached.