Skip to content

Commit 5ed57a5

Browse files
committed
add more cache indicator headers
1 parent 04b81da commit 5ed57a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/utils.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,10 @@ func checkCacheHit(value string, indicator string) bool {
330330
return true
331331
}
332332
}
333+
} else if strings.EqualFold("x-cc-via", indicator) {
334+
if strings.Contains(indicator, "[H,") {
335+
return true
336+
}
333337
// Some Headers may have "miss,hit" or "hit,miss" as value. But both are cached responses.
334338
} else if strings.Contains(strings.ToLower(value), "hit") || strings.Contains(strings.ToLower(value), "cached") {
335339
return true
@@ -380,7 +384,7 @@ func analyzeCacheIndicator(headers http.Header) (indicators []string) {
380384
case "cache-control", "pragma", "vary", "expires":
381385
msg := fmt.Sprintf("%s header was found: %s \n", key, val)
382386
PrintVerbose(msg, Cyan, 1)
383-
case "x-cache", "cf-cache-status", "x-drupal-cache", "x-varnish-cache", "akamai-cache-status", "server-timing", "x-iinfo", "x-nc", "x-hs-cf-cache-status", "x-proxy-cache", "x-cache-hits", "x-cache-status", "x-cache-info", "x-rack-cache", "cdn_cache_status", "x-akamai-cache", "x-akamai-cache-remote", "x-cache-remote", "x-litespeed-cache", "x-kinsta-cache", "x-ac", "cache-status", "ki-cf-cache-status", "eo-cache-status", customCacheHeader:
387+
case "x-cache", "cf-cache-status", "x-drupal-cache", "x-varnish-cache", "akamai-cache-status", "server-timing", "x-iinfo", "x-nc", "x-hs-cf-cache-status", "x-proxy-cache", "x-cache-hits", "x-cache-status", "x-cache-info", "x-rack-cache", "cdn_cache_status", "cache_status", "x-akamai-cache", "x-akamai-cache-remote", "x-cache-remote", "x-litespeed-cache", "x-kinsta-cache", "x-ac", "cache-status", "ki-cf-cache-status", "eo-cache-status", "x-77-cache", "x-cache-lookup", "x-cc-via", customCacheHeader:
384388
// CacheHeader flag might not be set (=> ""). Continue in this case
385389
if key == "" {
386390
continue

0 commit comments

Comments
 (0)