locked
Video Application Cache

    Question

  • Hi All,

    a user of my app has just made me aware of the fact, that all videos in the HTML5 player are cached on the disk. (In package folder/AC)
    This can quickly get very big when watching HD videos etc. (especially on a device with only 20GB or of usable space or so...)

    How can I clear this cache?

    Is this cache automatically cleaned by Windows?

    I can't see the files causing the large folder size in Windows Explorer, and I can't find any documentation on what cache this is.

    Any help would be greatly appreciated!

    CensoredUser

    Sunday, October 28, 2012 4:40 PM

Answers

  • Okay I tried it. It does not work. It clears all Data BUT the cache I want to clear.
    I looked in the C# Forums Matt Small actually stated there is no way of clearing this cache.

    For me one question remains open though: will Windows delete old Files here automatically?
    Because if that does not happen, a 16GB Drive could fill up very quickly just by the user watching a bunch of HD videos.

    Thanks for all your help on this!

    • Marked as answer by CensoredUser Monday, November 05, 2012 7:22 PM
    Monday, November 05, 2012 7:21 PM
  • Yes, it is cleared automatically by Windows.  We have not published what that algorithm is however.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, November 05, 2012 8:38 PM
    Moderator

All replies

  • Hi,

    Please try the code as follow:

    <video id="video-01" height="320" width="480" controls>
        <source src="my-video.mp4" type="video/mp4">
    </video>
    …
    <script>
        document.getElementById('video-01').autobuffer = false;
    </script>


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    Monday, October 29, 2012 7:44 AM
  • Hi,

    this does not fix my issue. The video still buffers and plays fine, but it is still cached in the app's package folder.
    (C:\Users\%username%\AppData\Local\Packages\%packagename%\AC)

    Essentially what I am looking for is a way to clear obsolete data from this cache (like after the video has played).
    Of course I would only need this if this cache is not maintained by Windows automagically (which would save me all the work).

    So my question is: is the cache (in the folder mentioned above) cleared by Windows when it is obsolete or space is needed?
    If not, how do I clear it programmatically?

    Thanks

    Monday, October 29, 2012 7:35 PM
  • Hi,

    I think the job you could do is not download the video automatically. And you could set <video preload="auto|metadata|none">.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    • Marked as answer by Song Tian Friday, November 02, 2012 10:12 AM
    • Unmarked as answer by CensoredUser Sunday, November 04, 2012 10:46 PM
    Tuesday, October 30, 2012 2:18 AM
  • Hi,

    again, this doesn't fix my issue. I don't mind the player buffering, in fact I want the player to buffer. But I don't want to keep that buffered data in the Application Cache if Windows doesn't automatically reclaim this space. I want the buffered data to be removed after the video has finished playing or another source has been selected.

    Again, the main question I have is whether this cache (C:\Users\%username%\AppData\Local\Packages\%packagename%\AC) is managed by Windows and whether the space is reclaimed by Windows when there is little Local Storage space left.

    Thanks for your help

    Censored

    Thursday, November 01, 2012 9:36 AM
  • Hi,

    I think you can't do that directly with winjs.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    Thursday, November 01, 2012 10:01 AM
  • I have done some more research into this. The folder that is causing the large size is INetCache.
    This folder contains images loaded from the web via setting img tags src, as well as video data loaded from the video tag.
    The folder is set as protected OS file folder, that's why I couldn't see it initially.

    I suppose the space this folder uses is then automatically cleared when the Disk is low on space?

    Sunday, November 04, 2012 10:50 PM
  • Hi,

    Ok. Have a try with ApplicationData.ClearAsync() http://msdn.microsoft.com/en-us/library/windows/apps/hh701423.aspx .

    If that still doesn't work. I think there is no better way.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    • Marked as answer by Song Tian Monday, November 05, 2012 9:45 AM
    • Unmarked as answer by CensoredUser Monday, November 05, 2012 8:53 PM
    Monday, November 05, 2012 8:29 AM
  • Okay I tried it. It does not work. It clears all Data BUT the cache I want to clear.
    I looked in the C# Forums Matt Small actually stated there is no way of clearing this cache.

    For me one question remains open though: will Windows delete old Files here automatically?
    Because if that does not happen, a 16GB Drive could fill up very quickly just by the user watching a bunch of HD videos.

    Thanks for all your help on this!

    • Marked as answer by CensoredUser Monday, November 05, 2012 7:22 PM
    Monday, November 05, 2012 7:21 PM
  • Yes, it is cleared automatically by Windows.  We have not published what that algorithm is however.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, November 05, 2012 8:38 PM
    Moderator