~aasg/snowweb

7caa04cdaf5f7cfa0b8dad3cf3def28cba0f436c — Aluísio Augusto Silva Gonçalves 4 months ago 749f15b 1.0.0
Don't cache API responses

Borrowed this from dn42regsrv, makes sense to me.
1 files changed, 2 insertions(+), 0 deletions(-)

M snowweb_server.go
M snowweb_server.go => snowweb_server.go +2 -0
@@ 122,6 122,7 @@ func (h *SnowWebServer) Realise() error {

// serveStatus responds to a request to the /.snowweb/status endpoint.
func (h *SnowWebServer) serveStatus(w http.ResponseWriter, r *http.Request) {
	w.Header().Add("Cache-Control", "no-store")
	w.Header().Add("Vary", "Accept")

	if r.Method != "GET" && r.Method != "HEAD" {


@@ 156,6 157,7 @@ func (h *SnowWebServer) serveStatus(w http.ResponseWriter, r *http.Request) {

// serveReload responds to a request to the /.snowweb/reload endpoint.
func (h *SnowWebServer) serveReload(w http.ResponseWriter, r *http.Request) {
	w.Header().Add("Cache-Control", "no-store")
	w.Header().Add("Vary", "Accept")

	if r.Method != "POST" {