This commit is contained in:
@@ -40,6 +40,12 @@ func (a *App) handleListPools(w http.ResponseWriter, r *http.Request) {
|
||||
if pools == nil {
|
||||
pools = []models.Pool{}
|
||||
}
|
||||
|
||||
// Set cache-control headers to prevent caching - pools list changes frequently
|
||||
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
w.Header().Set("Pragma", "no-cache")
|
||||
w.Header().Set("Expires", "0")
|
||||
|
||||
writeJSON(w, http.StatusOK, pools)
|
||||
}
|
||||
|
||||
@@ -114,6 +120,11 @@ func (a *App) handleDeletePool(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// Set cache-control headers to prevent caching of this response
|
||||
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
w.Header().Set("Pragma", "no-cache")
|
||||
w.Header().Set("Expires", "0")
|
||||
|
||||
writeJSON(w, http.StatusOK, map[string]string{"message": "pool destroyed", "name": name})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user