Cache 404 answers (#646)

pull/678/head
Igor Chubin 3 years ago
parent 50670c677d
commit 647127edc4

@ -54,7 +54,7 @@ func processRequest(r *http.Request) responseWithHeader {
if !foundInCache {
lruCache.Add(cacheDigest, responseWithHeader{InProgress: true})
response = get(r)
if response.StatusCode == 200 || response.StatusCode == 304 {
if response.StatusCode == 200 || response.StatusCode == 304 || response.StatusCode == 404 {
lruCache.Add(cacheDigest, response)
} else {
log.Printf("REMOVE: %d response for %s from cache\n", response.StatusCode, cacheDigest)

Loading…
Cancel
Save