shouldCache returns true if the request targets a host we want to cache. When no suffixes are configured, all GETs are cached (legacy behavior).
(r *http.Request)
| 125 | sf.mu.Unlock() |
| 126 | c.wg.Wait() |
| 127 | return c.res, c.err |
| 128 | } |
| 129 | c := &call{start: time.Now()} |
| 130 | c.wg.Add(1) |
| 131 | sf.m[key] = c |
| 132 | sf.mu.Unlock() |
| 133 | |
| 134 | c.res, c.err = fn() |
| 135 | c.wg.Done() |
| 136 | |
| 137 | sf.mu.Lock() |
| 138 | delete(sf.m, key) |
| 139 | sf.mu.Unlock() |
| 140 | |
| 141 | return c.res, c.err |
| 142 | } |
| 143 | |
| 144 | // InFlight reports whether a fill for key is currently executing, and how |