From e235c7aea2bd49a484d487e44a33bf0408c39092 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 11 Dec 2023 20:19:39 -0800 Subject: [PATCH] chore: remove reponse cache from root route --- controllers/hls.go | 2 +- router/router.go | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/controllers/hls.go b/controllers/hls.go index 2a8b5210a..1b951aca5 100644 --- a/controllers/hls.go +++ b/controllers/hls.go @@ -42,7 +42,7 @@ func HandleHLSRequest(w http.ResponseWriter, r *http.Request) { if hlsCacheAdapter == nil { ca, err := memory.NewAdapter( - memory.AdapterWithAlgorithm(memory.LFU), + memory.AdapterWithAlgorithm(memory.LRU), memory.AdapterWithCapacity(50), memory.AdapterWithStorageCapacity(104_857_600), ) diff --git a/router/router.go b/router/router.go index be51877b8..98d2bc457 100644 --- a/router/router.go +++ b/router/router.go @@ -64,13 +64,7 @@ func Start() error { log.Warn("unable to create web cache client", err) } // The primary web app. - if enableCache { - http.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) { - longerDurationCacheClient.Middleware(http.HandlerFunc(controllers.IndexHandler)).ServeHTTP(rw, r) - }) - } else { - http.HandleFunc("/", controllers.IndexHandler) - } + http.HandleFunc("/", controllers.IndexHandler) // The admin web app. http.HandleFunc("/admin/", middleware.RequireAdminAuth(controllers.IndexHandler))