![](refresh_8h__incl.png)
![](refresh_8h__dep__incl.png)
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-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().
◆ refreshAddToList()
◆ refreshCheckDigest()
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().
◆ refreshCheckHTCP()
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().
◆ 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
-
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().
◆ refreshCheckICP()
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().
◆ refreshInit()
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().
◆ 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
-
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().
◆ 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
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products