Cached smooth stream is permanently stored on disk

Topics: Windows 10 UWP
Jan 9, 2016 at 9:52 AM

when playing smooth stream video, all received data is stored on disk in C:/Users/<user>/AppData/Local/Packages/<appPackageName>/AC/INetCache/<randomChars>. For example: Fragments(video=40040000)[1].mp4
This can be seen through command line dir /s, for some reason INetCache and subdirectories are not visible in file explorer. This is a big issue because it can take up 1 GB of storage in less than one hour of playing, depending on the streaming source. This will soon consume all of device's memory. Phone users usually have something like 16 GB so you can see it's a big issue.

We are stuck on this, any help is appreciated. How to limit the cache or how to delete it? Where does it come from (PlayerFramework, AdaptivePlugin or deeper)?

Streaming url example:

There is nothing extra in the code, but, here it is anyway:
---- Xaml page ----
<PlayerFramework:MediaPlayer x:Name="mediaPlayer" IsVolumeVisible="True" />
---- Cs page ----
public PlayerFrameworkCleanPage() {
adaptivePlugin = new Microsoft.PlayerFramework.Adaptive.AdaptivePlugin() { StartupBitrate = uint.MaxValue };
mediaPlayer.Source = new Uri("");

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) {
base.OnNavigatingFrom(e); mediaPlayer.Dispose();

Thanks! BR, Marko
Jan 19, 2016 at 2:52 PM
Hi Marko,

Nothing in the AdaptivePlugin is writing to disk which means this behavior you are seeing must coming from the Smooth client itself. Have you tried taking PF out of the equation and just using MediaElement and Smooth client?
Jan 20, 2016 at 2:35 PM
Hi ibennett,

streaming via MediaElement also stores those files. So, it is not due to PlayerFramework. But thanks for pointing it out (case of not seeing the forest for the trees).
<MediaElement x:Name="mediaElement" Source="..." />
MediaExtensionManager extensionManager = new MediaExtensionManager();
extensionManager.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "text/xml");
extensionManager.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "application/");
First I thought that AC/Inetcache is a custom directory for Smooth Streaming Client, but then I realized every downloaded file is cached there.
For example, when using this line of code in xaml page file:
<Image x:Name="img" Source="" />
file actionbar_subscribe[1].png will be saved to subdirectory of Inetcache. I guess it's a uwp caching thing after all. Though, I would expect it to end up in LocalCache directory. If this was necessary to be stored anywhere in the first place...
Then I found out this: My German is heavily rusted, but what I could figure out is that Runtimebroker is a service responsible for this. But it doesn't say much more than this. There isn't much (or anything) on that Inetcache thing on web...

Our quick workaround was to manually delete those files on interval of 1 minute. Cache cleaning is started on the page with video player and it is stopped in OnNavigatingFrom event. It's not a very intelligent solution but it does the job. In case someone else encounters this problem, here is the code.
class CacheCleanup : IDisposable
    private DispatcherTimer cleanCacheTimer;
    public CacheCleanup(TimeSpan? cleanInterval = null)
        if (!cleanInterval.HasValue)
            cleanInterval = TimeSpan.FromMinutes(1);

        cleanCacheTimer = new DispatcherTimer();
        cleanCacheTimer.Interval = cleanInterval.Value;
        cleanCacheTimer.Tick += CleanCacheTimer_Tick;

    private void CleanCacheTimer_Tick(object sender, object e)
            StorageFolder localDirectory = ApplicationData.Current.LocalFolder;
            string[] tmpCacheDirectories = Directory.GetDirectories(localDirectory.Path + "\\..\\ac\\inetcache");
            foreach (string dir in tmpCacheDirectories)
                string[] tmpCacheFiles = Directory.GetFiles(dir, "*.mp4");
                foreach (string file in tmpCacheFiles)
                    if (File.GetLastAccessTime(file) < DateTime.Now.AddMinutes(-1))
                            Debug.WriteLine("Deleted: " + file);
                        catch (Exception) { }
        catch (Exception ex)     { Debug.WriteLine("ERROR CLEANING CACHE: " + ex.Message);  }

    public void Dispose()
        if (cleanCacheTimer != null)
            cleanCacheTimer = null;
If anyone has better solution or some more information about this caching thing, we will be happy to hear it. Thanks!
BR, Marko
Jan 20, 2016 at 2:59 PM
Jan 21, 2016 at 12:51 PM
Thanks ibennett, I'll do that
Jan 21, 2016 at 2:03 PM
Just an update... This is a known issue since Windows 8.
Here is the thread in msdn forum:
Stay tuned...
Jan 21, 2016 at 5:49 PM
Thanks for chasing this down!