add some caching times willy nilly
This commit is contained in:
parent
7d538d465f
commit
c4b14dd513
1 changed files with 7 additions and 0 deletions
7
honk.go
7
honk.go
|
|
@ -371,6 +371,7 @@ func outbox(w http.ResponseWriter, r *http.Request) {
|
||||||
j["totalItems"] = len(jonks)
|
j["totalItems"] = len(jonks)
|
||||||
j["orderedItems"] = jonks
|
j["orderedItems"] = jonks
|
||||||
|
|
||||||
|
w.Header().Set("Cache-Control", "max-age=60")
|
||||||
w.Header().Set("Content-Type", theonetruename)
|
w.Header().Set("Content-Type", theonetruename)
|
||||||
WriteJunk(w, j)
|
WriteJunk(w, j)
|
||||||
}
|
}
|
||||||
|
|
@ -384,6 +385,7 @@ func viewuser(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
if friendorfoe(r.Header.Get("Accept")) {
|
if friendorfoe(r.Header.Get("Accept")) {
|
||||||
j := asjonker(user)
|
j := asjonker(user)
|
||||||
|
w.Header().Set("Cache-Control", "max-age=600")
|
||||||
w.Header().Set("Content-Type", theonetruename)
|
w.Header().Set("Content-Type", theonetruename)
|
||||||
WriteJunk(w, j)
|
WriteJunk(w, j)
|
||||||
return
|
return
|
||||||
|
|
@ -444,6 +446,7 @@ func fingerlicker(w http.ResponseWriter, r *http.Request) {
|
||||||
links = append(links, l)
|
links = append(links, l)
|
||||||
j["links"] = links
|
j["links"] = links
|
||||||
|
|
||||||
|
w.Header().Set("Cache-Control", "max-age=3600")
|
||||||
w.Header().Set("Content-Type", "application/jrd+json")
|
w.Header().Set("Content-Type", "application/jrd+json")
|
||||||
WriteJunk(w, j)
|
WriteJunk(w, j)
|
||||||
}
|
}
|
||||||
|
|
@ -464,6 +467,7 @@ func viewhonk(w http.ResponseWriter, r *http.Request) {
|
||||||
if friendorfoe(r.Header.Get("Accept")) {
|
if friendorfoe(r.Header.Get("Accept")) {
|
||||||
_, j := jonkjonk(user, h)
|
_, j := jonkjonk(user, h)
|
||||||
j["@context"] = itiswhatitis
|
j["@context"] = itiswhatitis
|
||||||
|
w.Header().Set("Cache-Control", "max-age=3600")
|
||||||
w.Header().Set("Content-Type", theonetruename)
|
w.Header().Set("Content-Type", theonetruename)
|
||||||
WriteJunk(w, j)
|
WriteJunk(w, j)
|
||||||
return
|
return
|
||||||
|
|
@ -478,6 +482,9 @@ func honkpage(w http.ResponseWriter, r *http.Request, u *UserInfo, user *WhatAbo
|
||||||
templinfo["UserCSRF"] = GetCSRF("saveuser", r)
|
templinfo["UserCSRF"] = GetCSRF("saveuser", r)
|
||||||
templinfo["HonkCSRF"] = GetCSRF("honkhonk", r)
|
templinfo["HonkCSRF"] = GetCSRF("honkhonk", r)
|
||||||
}
|
}
|
||||||
|
if u == nil {
|
||||||
|
w.Header().Set("Cache-Control", "max-age=60")
|
||||||
|
}
|
||||||
if user != nil {
|
if user != nil {
|
||||||
templinfo["Name"] = user.Name
|
templinfo["Name"] = user.Name
|
||||||
whatabout := user.About
|
whatabout := user.About
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue