all repos — honk @ 4a0a0768c71c2bdcee020fd35f47142071c5d410

my fork of honk

add some caching times willy nilly
Ted Unangst tedu@tedunangst.com
Tue, 16 Apr 2019 22:23:50 -0400
commit

4a0a0768c71c2bdcee020fd35f47142071c5d410

parent

61efaeb33b39829907235c340792765a773005cf

1 files changed, 7 insertions(+), 0 deletions(-)

jump to
M honk.gohonk.go

@@ -371,6 +371,7 @@ j["type"] = "OrderedCollection"

j["totalItems"] = len(jonks) j["orderedItems"] = jonks + w.Header().Set("Cache-Control", "max-age=60") w.Header().Set("Content-Type", theonetruename) WriteJunk(w, j) }

@@ -384,6 +385,7 @@ return

} if friendorfoe(r.Header.Get("Accept")) { j := asjonker(user) + w.Header().Set("Cache-Control", "max-age=600") w.Header().Set("Content-Type", theonetruename) WriteJunk(w, j) return

@@ -444,6 +446,7 @@ l["href"] = user.URL

links = append(links, l) j["links"] = links + w.Header().Set("Cache-Control", "max-age=3600") w.Header().Set("Content-Type", "application/jrd+json") WriteJunk(w, j) }

@@ -464,6 +467,7 @@ }

if friendorfoe(r.Header.Get("Accept")) { _, j := jonkjonk(user, h) j["@context"] = itiswhatitis + w.Header().Set("Cache-Control", "max-age=3600") w.Header().Set("Content-Type", theonetruename) WriteJunk(w, j) return

@@ -477,6 +481,9 @@ templinfo := getInfo(r)

if u != nil && u.Username == user.Name { templinfo["UserCSRF"] = GetCSRF("saveuser", r) templinfo["HonkCSRF"] = GetCSRF("honkhonk", r) + } + if u == nil { + w.Header().Set("Cache-Control", "max-age=60") } if user != nil { templinfo["Name"] = user.Name