refresh.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void refreshAddToList (const char *, int, time_t, int, time_t)
 
bool refreshIsCachable (const StoreEntry *)
 
int refreshCheckHTTP (const StoreEntry *, HttpRequest *)
 
int refreshCheckICP (const StoreEntry *, HttpRequest *)
 
int refreshCheckHTCP (const StoreEntry *, HttpRequest *)
 
int refreshCheckDigest (const StoreEntry *, time_t delta)
 
time_t getMaxAge (const char *url)
 
void refreshInit (void)
 
const RefreshPatternrefreshLimits (const char *url)
 

Function Documentation

time_t getMaxAge ( const char *  url)

Get the configured maximum caching time for objects with this URL according to refresh_pattern.

Used by http.cc when generating a upstream requests to ensure that responses it is given are fresh enough to be worth caching.

Return values
pattern-maxif there is a refresh_pattern matching the URL configured.
REFRESH_DEFAULT_MAXif there are no explicit limits configured

Definition at line 646 of file refresh.cc.

References debugs, RefreshPattern::max, REFRESH_DEFAULT_MAX, and refreshLimits().

Referenced by HttpStateData::httpBuildRequestHeader().

void refreshAddToList ( const char *  ,
int  ,
time_t  ,
int  ,
time_t   
)
int refreshCheckHTCP ( const StoreEntry entry,
HttpRequest request 
)
int refreshCheckHTTP ( const StoreEntry entry,
HttpRequest request 
)

Protocol-specific wrapper around refreshCheck() function.

Note the reason for STALE/FRESH then return true/false respectively.

Return values
1if STALE
0if FRESH

Definition at line 589 of file refresh.cc.

References Config, HttpRequest::flags, SquidConfig::offline, SquidConfig::onoff, rcHTTP, refreshCheck(), refreshCounts, refreshIsStaleIfHit(), RequestFlags::staleIfHit, RefreshCounts::status, and RefreshCounts::total.

Referenced by clientReplyContext::cacheHit().

int refreshCheckICP ( const StoreEntry entry,
HttpRequest request 
)
void refreshInit ( void  )
bool refreshIsCachable ( const StoreEntry entry)

This is called by http.cc once it has received and parsed the origin server's response headers. It uses the result as part of its algorithm to decide whether a response should be cached.

Return values
trueif the entry is cacheable, regardless of whether FRESH or STALE
falseif the entry is not cacheable

TODO: this algorithm seems a bit odd and might not be quite right. Verify against HTTPbis.

Definition at line 529 of file refresh.cc.

References Config, Http::Message::content_length, StoreEntry::getReply(), StoreEntry::lastModified(), StoreEntry::mem_obj, SquidConfig::minimum_expiry_time, NULL, rcStore, refreshCheck(), refreshCounts, STALE_MUST_REVALIDATE, RefreshCounts::status, and RefreshCounts::total.

Referenced by HttpStateData::reusableReply().

const RefreshPattern* refreshLimits ( const char *  url)

Locate the first refresh_pattern rule that matches the given URL by regex.

Returns
A pointer to the refresh_pattern parameters to use, or nullptr if there is no match.

Definition at line 93 of file refresh.cc.

References Config, RefreshPattern::next, and SquidConfig::Refresh.

Referenced by getMaxAge(), and refreshCheck().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors