refresh.h File Reference
#include "http/forward.h"
#include "store/forward.h"
Include dependency graph for refresh.h:
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 RefreshPattern * refreshLimits (const char *url)
 

Function Documentation

◆ getMaxAge()

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 633 of file refresh.cc.

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

Referenced by HttpStateData::httpBuildRequestHeader().

◆ refreshAddToList()

void refreshAddToList ( const char *  ,
int  ,
time_t  ,
int  ,
time_t   
)

◆ refreshCheckDigest()

◆ refreshCheckHTCP()

int refreshCheckHTCP ( const StoreEntry *  entry,
HttpRequest *  request 
)

◆ refreshCheckHTTP()

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 575 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().

◆ refreshCheckICP()

◆ refreshInit()

void refreshInit ( void  )

◆ refreshIsCachable()

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 519 of file refresh.cc.

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

Referenced by HttpStateData::reusableReply().

◆ refreshLimits()

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 92 of file refresh.cc.

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

Referenced by getMaxAge(), and refreshCheck().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors