Home / Function/ isNoCache() — fiber Function Reference

isNoCache() — fiber Function Reference

Architecture documentation for the isNoCache() function in helpers.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  2a711602_e28d_a57c_f667_2ade6be227cd["isNoCache()"]
  bec0e401_e4cd_f765_6df3_a79059073e50["helpers.go"]
  2a711602_e28d_a57c_f667_2ade6be227cd -->|defined in| bec0e401_e4cd_f765_6df3_a79059073e50
  321594bd_9fd9_917f_ca1a_7e825e49229c["matchNoCacheToken()"]
  2a711602_e28d_a57c_f667_2ade6be227cd -->|calls| 321594bd_9fd9_917f_ca1a_7e825e49229c
  07b37e65_2d73_286b_43ad_57371b2c274b["isNoCacheDelimiter()"]
  2a711602_e28d_a57c_f667_2ade6be227cd -->|calls| 07b37e65_2d73_286b_43ad_57371b2c274b
  style 2a711602_e28d_a57c_f667_2ade6be227cd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

helpers.go lines 777–806

func isNoCache(cacheControl string) bool {
	n := len(cacheControl)
	if n < len(noCacheValue) {
		return false
	}

	const noCacheLen = len(noCacheValue)
	const asciiCaseFold = byte(0x20)
	for i := 0; i <= n-noCacheLen; i++ {
		if (cacheControl[i] | asciiCaseFold) != 'n' {
			continue
		}
		if !matchNoCacheToken(cacheControl, i) {
			continue
		}
		if i > 0 && !isNoCacheDelimiter(cacheControl[i-1]) {
			continue
		}

		// Handle: "no-cache", "no-cache, ...", "no-cache=...", "no-cache ,"
		if i+noCacheLen == n {
			return true
		}
		if isNoCacheDelimiter(cacheControl[i+noCacheLen]) || cacheControl[i+noCacheLen] == '=' {
			return true
		}
	}

	return false
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does isNoCache() do?
isNoCache() is a function in the fiber codebase, defined in helpers.go.
Where is isNoCache() defined?
isNoCache() is defined in helpers.go at line 777.
What does isNoCache() call?
isNoCache() calls 2 function(s): isNoCacheDelimiter, matchNoCacheToken.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free