add some caching times willy nilly

This commit is contained in:
Ted Unangst 2019-04-16 22:23:50 -04:00
parent 7d538d465f
commit c4b14dd513
1 changed files with 7 additions and 0 deletions

View File

@ -371,6 +371,7 @@ func outbox(w http.ResponseWriter, r *http.Request) {
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 @@ func viewuser(w http.ResponseWriter, r *http.Request) {
}
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 @@ func fingerlicker(w http.ResponseWriter, r *http.Request) {
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 @@ func viewhonk(w http.ResponseWriter, r *http.Request) {
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
@ -478,6 +482,9 @@ func honkpage(w http.ResponseWriter, r *http.Request, u *UserInfo, user *WhatAbo
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
whatabout := user.About