|
Squid Web Cache master
|
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) |
| 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.
| pattern-max | if there is a refresh_pattern matching the URL configured. |
| REFRESH_DEFAULT_MAX | if there are no explicit limits configured |
Definition at line 639 of file refresh.cc.
References debugs, RefreshPattern::max, REFRESH_DEFAULT_MAX, and refreshLimits().
Referenced by HttpStateData::httpBuildRequestHeader().
| int refreshCheckDigest | ( | const StoreEntry * | entry, |
| time_t | delta | ||
| ) |
Definition at line 617 of file refresh.cc.
References RefCount< C >::getRaw(), StoreEntry::mem_obj, rcCDigest, refreshCheck(), refreshCounts, MemObject::request, RefreshCounts::status, and RefreshCounts::total.
Referenced by storeDigestAddable().
| int refreshCheckHTCP | ( | const StoreEntry * | entry, |
| HttpRequest * | request | ||
| ) |
Definition at line 604 of file refresh.cc.
References rcHTCP, refreshCheck(), refreshCounts, RefreshCounts::status, and RefreshCounts::total.
Referenced by htcpSpecifier::checkHit().
| int refreshCheckHTTP | ( | const StoreEntry * | entry, |
| HttpRequest * | request | ||
| ) |
Protocol-specific wrapper around refreshCheck() function.
Note the reason for STALE/FRESH then return true/false respectively.
| 1 | if STALE |
| 0 | if FRESH |
Do not call this when StoreClient::didCollapse is true. XXX: Callers should not have to remember to check didCollapse. TODO: Refactor by adding something like pure virtual StoreClient::refreshCheck() with protocol specializations?
Definition at line 582 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 | ||
| ) |
Definition at line 593 of file refresh.cc.
References rcICP, refreshCheck(), refreshCounts, RefreshCounts::status, and RefreshCounts::total.
Referenced by ICPState::confirmAndPrepHit().
| void refreshInit | ( | void | ) |
Definition at line 760 of file refresh.cc.
References RefreshCounts::proto, rcCDigest, rcHTCP, rcHTTP, rcICP, rcStore, refreshCounts, and refreshRegisterWithCacheManager().
Referenced by mainInitialize().
| 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.
| true | if the entry is cacheable, regardless of whether FRESH or STALE |
| false | if the entry is not cacheable |
TODO: this algorithm seems a bit odd and might not be quite right. Verify against HTTPbis.
Definition at line 518 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().
| const RefreshPattern * refreshLimits | ( | const char * | url | ) |
Locate the first refresh_pattern rule that matches the given URL by regex.
Definition at line 92 of file refresh.cc.
References Config, and SquidConfig::Refresh.
Referenced by getMaxAge(), and refreshCheck().