diff --git a/handler/handler.go b/handler/handler.go index 523e4e2..949ab1f 100644 --- a/handler/handler.go +++ b/handler/handler.go @@ -71,6 +71,14 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Write([]byte("OK")) return } + if r.URL.Path == "/clearcache" { + h.cacheMut.Lock() + h.cache = map[string]QueryResult{} + h.cacheMut.Unlock() + w.WriteHeader(http.StatusOK) + w.Write([]byte("Cache cleared")) + return + } // calculate response type ext := "" script := ""