{{define "content"}} {{$c := .Data.Stats}}{{$csrf := .CSRF}}

Cache

Responses held in memory to answer repeat queries instantly.

Cache settings {{template "confirmform" dict "Action" "/cache/flush" "CSRF" $csrf "Label" "Flush entire cache" "Icon" "bi-trash" "Class" "btn btn-sm btn-danger" "Message" "Flush every cached response? Queries will go back upstream until the cache refills."}}
{{if not $c.Enabled}}
The cache is turned off. Every recursive query is forwarded upstream.
{{end}}
{{template "stat" dict "Label" "Entries" "Value" (num $c.Entries) "Icon" "bi-database" "Sub" (printf "limit %s" (num $c.MaxEntries))}} {{template "stat" dict "Label" "Hit rate" "Value" (pct $c.HitRate) "Icon" "bi-lightning-charge" "Tone" "success"}} {{template "stat" dict "Label" "Hits" "Value" (num $c.Hits) "Icon" "bi-check-circle" "Tone" "success" "Sub" (printf "%s served stale" (num $c.StaleHits))}} {{template "stat" dict "Label" "Misses" "Value" (num $c.Misses) "Icon" "bi-x-circle"}} {{template "stat" dict "Label" "Memory estimate" "Value" (bytes $c.Bytes) "Icon" "bi-memory"}} {{template "stat" dict "Label" "Insertions" "Value" (num $c.Insertions) "Icon" "bi-box-arrow-in-down"}} {{template "stat" dict "Label" "Evictions" "Value" (num $c.Evictions) "Icon" "bi-box-arrow-up" "Sub" "least recently used first"}} {{template "stat" dict "Label" "Expirations" "Value" (num $c.Expirations) "Icon" "bi-hourglass-bottom"}}
Cached entries TTL clamped to {{$c.MinTTL}}–{{$c.MaxTTL}}s · negative {{$c.NegativeTTL}}s {{if $c.ServeStale}}· serves stale for {{$c.StaleTTL}}s{{end}} {{if $c.Prefetch}}· prefetch on{{end}}
{{if .Data.Entries}}
{{range .Data.Entries}} {{end}}
NameTypeResult AnswersTTL left SizeCachedActions
{{trimDot .Name}} {{.Type}} {{if .DO}}+do{{end}} {{.Rcode}} {{if .Negative}}negative{{end}} {{.Answers}} {{if .Stale}}stale{{else}}{{.TTL}}s{{end}} {{bytes .Size}} {{timeAgo .Stored}} {{template "confirmform" dict "Action" "/cache/delete" "CSRF" $csrf "Icon" "bi-trash" "Title" "Remove this entry" "Fields" (dict "name" .Name "type" .Type "dnssec" (boolstr .DO)) "Message" (printf "Remove the cached %s answer for %s?" .Type (trimDot .Name))}}
{{template "pagination" dict "P" .Data.Pagination "Q" .Query}} {{else if .Data.Search}} {{template "empty" dict "Icon" "bi-search" "Title" "Nothing cached matches that name" "Message" "The entry may have expired, or the name may never have been queried."}} {{else}} {{template "empty" dict "Icon" "bi-lightning-charge" "Title" "The cache is empty" "Message" "Recursive answers are cached here as clients query them."}} {{end}}
{{end}}