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

Mapped mode, how to clear json cache ? #1529

Open
nvtienlg opened this issue Jun 20, 2024 · 2 comments
Open

Mapped mode, how to clear json cache ? #1529

nvtienlg opened this issue Jun 20, 2024 · 2 comments

Comments

@nvtienlg
Copy link

We are testing this module with mapped mode. Everything is working fine, however we don't know how to clear json cache to refetch it

  1. User requests {videoId}/master.m3u8
  2. Module calls to api backend api/json/{videoId}
  3. Api responses the json (include 360p and 480p)
  4. Module parses and caches it
  5. New 720p and 1080p come later (due to long transcoding), api backend already updated

How to force the Module to call api to refresh the json cache for given {videoId} ?
We can set expiration for vod_mapping_cache, but that affects all videos, lets say calling to api is costly

Hope you understand the case. Thank you very much for great module

@erankor
Copy link
Contributor

erankor commented Jun 21, 2024

There is no support for cache invalidation, mainly because it won't help when there's a CDN in front of this module.
What you can do instead is make a change to the URL - assuming you have some API that generates the master.m3u8 URL to the player, you can make a change there, the module will "see" a new URL, and will perform the mapping request again.
For example, initially you return http://yourdomain/path/version/1/master.m3u8, after the transcoding is finished, you return http://yourdomain/path/version/2/master.m3u8.

@nvtienlg
Copy link
Author

Thank you very much, got your point. What we done, base on your suggestion:

With that config seem we can update master playlist while keep using cache for media segments

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

No branches or pull requests

2 participants