MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / cacheable

Function cacheable

auth/oidc.go:784–790  ·  view source on GitHub ↗

cacheable determines whether the provider discovery response can be cached. Returns the invalidate interval with a value true when the response is cacheable and zero interval with a value false otherwise.

(header http.Header)

Source from the content-addressed store, hash-verified

782// Returns the invalidate interval with a value true when the response is cacheable
783// and zero interval with a value false otherwise.
784func cacheable(header http.Header) (ttl time.Duration, ok bool, err error) {
785 ttl, ok, err = cacheControlMaxAge(header)
786 if err != nil || ok {
787 return ttl, ok, err
788 }
789 return getExpiration(header)
790}
791
792// GetOIDCClientContext returns a new Context that carries the provided HTTP client
793// with TLS certificate verification disabled when insecureSkipVerify is true and

Callers 3

TestCacheablePassFunction · 0.85
TestCacheableFailFunction · 0.85

Calls 2

cacheControlMaxAgeFunction · 0.85
getExpirationFunction · 0.85

Tested by 2

TestCacheablePassFunction · 0.68
TestCacheableFailFunction · 0.68