Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear cache #159

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Clear cache #159

wants to merge 4 commits into from

Conversation

knezmilos13
Copy link

Hi, I added a couple of things that I needed so just wanted to see if you want them in original project as well. If not, nvm :)

I wanted to be able to:

  • clear entire cache from time to time, e.g. when completely changing the "playlist". I used your code from the sample for this (and also updated the sample to remove that, now redundant, code)
  • clear single cached video when I 100% know it won't get played again; that way I might avoid another video getting kicked out from the cache because there's not enough space

I've noticed a problem - it seems that the info storage entries are never removed, even if the corresponding video is removed from cache. The entries may be small, but even if it takes thousands, it's a risk I can't take, so I had both of those operations above do the full storage clear and sigle entry clear respectively. I didn't try to implement this when the normal removal of old cached files is done, the "clear entire cache" thingy is enough for me, since I call that periodically.

@wojtow
Copy link

wojtow commented Apr 5, 2019

Thank you for sharing these changes. I was just about to implement similar functionality myself. In my case, the content at the source periodically changes, but the URL doesn't and prior to this, there was no easy way to clean out the cache to force it to download new.

@jdpxiaoming
Copy link

good news .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants