RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
235 stars 28 forks source link

[Question] How to clear HTTP cache for remote MP4 videos #1271

Closed christianYS closed 2 years ago

christianYS commented 2 years ago

Is there a way to clear the HTTP cache for MP4 videos loaded from a remote URL? We noticed that loading times are much shorter when playing a video for the second time. We would like to have a consistent app state for testing purposes, and we would like to validate the case when the user is playing the video for the first time to check any issues and measure the performances. This doesn't need to happen from code, as it's only for in-house testing and QA.

  1. How to avoid caching videos on iOS, Android, Windows and MacOS?
  2. What is the right way to delete the already cached videos on iOS, Android, Windows and MacOS?
  3. Is it enough to delete and reinstall the app on iOS/Android?
Chris-RH commented 2 years ago

Hi @christianYS,

Those are very interesting questions. Due to staff holidays, we won't initially be able to find answers for all platforms, but we'll look into this.

Ste-RH commented 2 years ago

Assuming you are not referring to the built in caching/download features present on Android/iOS only...

It feels like this might be beyond the scope of the AVPro Video asset. I cannot see anything obvious/evident to perform an HTTP cache clear. I will leave this open to get feedback from other team members here as they return from annual leave.

Chris-RH commented 2 years ago
  1. Most likely not possible on iOS/MacOS as caching is handled by the OS and doesn’t go through the regular URL caching scheme.
  2. Http cache-control headers are supported, so you could set your server up to say don't cache this for specific test media.
  3. Deleting the App is unlikely to make a difference.
Chris-RH commented 2 years ago

Final answer from Windows Dev: Cache-control headers probably best bet as no obvious routes for us to explicitly access/clear caches, especially with so many (abstracted) APIs/filters/routes on Windows

I hope that answers everything for you.