From 96b98957350fea7eec50bce9e55af4d8f4a048e5 Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Fri, 22 Sep 2023 12:33:31 +0500 Subject: [PATCH] Removed client caching, fix for old video having mismatched codecs with new --- http/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/http/server.go b/http/server.go index 0bb826d..5006760 100644 --- a/http/server.go +++ b/http/server.go @@ -24,6 +24,7 @@ func server_setup(server *http.ServeMux) { } func serve_vid_segment(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Cache-Control", "no-cache") base_dir, _ := os.UserHomeDir() tmp := strings.Split(strings.TrimPrefix(r.URL.Path, "/vid/"), "/") stream_key := tmp[0] @@ -32,6 +33,7 @@ func serve_vid_segment(w http.ResponseWriter, r *http.Request) { } func serve_live_playlist(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Cache-Control", "no-cache") stream_id := strings.TrimPrefix(r.URL.Path, "/list/") base_dir, _ := os.UserHomeDir() stream_playlist_path := base_dir + "/live/" + stream_id + "/stream.m3u8"