Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanReuse ¶
func CanReuse( reqHeader http.Header, reqCacheControl rfc.CacheControlMap, cacheObj *CacheObj, strictRFC bool, revalidateCanReuse bool, ) bool
CanReuse is a helper wrapping github.com/apache/trafficcontrol/lib/go-rfc.CanReuseStored, returning a boolean rather than an enumerated "Reuse" value, for when it's known whether MustRevalidate can be used.
Types ¶
type CacheObj ¶
type CacheObj struct { Body []byte ReqHeaders http.Header RespHeaders http.Header RespCacheControl rfc.CacheControlMap Code int OriginCode int ProxyURL string ReqTime time.Time // our client's time when the object was requested ReqRespTime time.Time // our client's time when the object was received RespRespTime time.Time // the origin server's Date time when the object was sent LastModified time.Time // the origin LastModified if it exists, or Date if it doesn't Size uint64 HitCount uint64 // the number of times this object was hit }
func (CacheObj) ComputeSize ¶
ComputeSize computes the size of the given CacheObj. This computation is expensive, as the headers must be iterated over. Thus, the size should be computed once and stored, not computed on-the-fly for every new request for the cached object.
Click to show internal directories.
Click to hide internal directories.