Tweak cache parameters

This commit is contained in:
Simon Marsh 2020-10-31 12:01:23 +00:00
parent c6a608061e
commit f36e0ce71c
No known key found for this signature in database
GPG Key ID: 30B29A716A54DBB3
4 changed files with 11 additions and 11 deletions

View File

@ -90,7 +90,7 @@ func dnsRZoneHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a day
w.Header().Set("Cache-Control", "public, max-age=86400, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=86400")
switch format[0] {
case "bind":

View File

@ -315,7 +315,7 @@ func regRootHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a day, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=86400, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=86400")
w.Header().Set("ETag", RegistryData.Commit)
ResponseJSON(w, response)
@ -352,7 +352,7 @@ func regTypeHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a day, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=86400, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=86400")
w.Header().Set("ETag", RegistryData.Commit)
ResponseJSON(w, response)
@ -421,7 +421,7 @@ func regObjectHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a day, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=86400, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=86400")
w.Header().Set("ETag", RegistryData.Commit)
ResponseJSON(w, response)
@ -443,7 +443,7 @@ func regObjectHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a day, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=86400, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200 stale-if-error=86400")
w.Header().Set("ETag", RegistryData.Commit)
ResponseJSON(w, response)
@ -498,7 +498,7 @@ func regKeyHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a day, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=86400, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=86400")
w.Header().Set("ETag", RegistryData.Commit)
ResponseJSON(w, amap)
@ -552,7 +552,7 @@ func regAttributeHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a day, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=86400, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=86400")
w.Header().Set("ETag", RegistryData.Commit)
ResponseJSON(w, amap)

View File

@ -131,7 +131,7 @@ func roaFilterHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a week, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=604800, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=604800")
w.Header().Set("ETag", ROAData.Commit)
ResponseJSON(w, filters)
@ -152,7 +152,7 @@ func roaJSONHandler(w http.ResponseWriter, r *http.Request) {
}
// cache for up to a week, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=604800, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=604800")
w.Header().Set("ETag", ROAData.Commit)
ResponseJSON(w, ROAJSONResponse)
@ -183,7 +183,7 @@ func roaBirdHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
// cache for up to a week, but set etag to commit to catch changes
w.Header().Set("Cache-Control", "public, max-age=604800, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=7200, stale-if-error=604800")
w.Header().Set("ETag", ROAData.Commit)
fmt.Fprintf(w, "#\n# dn42regsrv ROA Generator\n# Last Updated: %s\n"+

View File

@ -58,7 +58,7 @@ func staticHandler(path string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// allow up to a month of caching
w.Header().Set("Cache-Control", "public, max-age=2592000, stale-if-error=86400")
w.Header().Set("Cache-Control", "public, max-age=2592000, stale-if-error=2592000")
server.ServeHTTP(w, r)
})
}