Content is stored in and retrieved from the cache using URI based keys. Content with access protection is not cached.
Further details, discussion, and examples, are provided in the Caching Guide.
When a cached entry becomes stale,
A small but finite amount of time exists between the time the cached entity becomes stale, and the time the stale entity is fully refreshed. On a busy server, a significant number of requests might arrive during this time, and cause a thundering herd of requests to strike the backend suddenly and unpredicably.
To keep the thundering herd at bay, the
When an entity is cached for the first time, a lock will be created for the entity until the response has been fully cached. During the lifetime of the lock, the cache will suppress the second and subsequent attempt to cache the same entity. While this doesn't hold back the thundering herd, it does stop the cache attempting to cache the same entity multiple times simultaneously.
When an entity reaches its freshness lifetime and becomes stale, a lock will be created for the entity until the response has either been confirmed as still fresh, or replaced by the backend. During the lifetime of the lock, the second and subsequent incoming request will cause stale data to be returned, and the thundering herd is kept at bay.
Locks are used as a hint only to enable the cache to be more gentle on backend servers, however the lock can be overridden if necessary. If the client sends a request with a Cache-Control header forcing a reload, any lock that may be present will be ignored, and the client's request will be honoured immediately and the cached entry refreshed.
As a further safety mechanism, locks have a configurable maximum age.
Once this age has been reached, the lock is removed, and a new request is
given the opportunity to create a new lock. This maximum age can be set using
the
The disk instructs
In the event that the URL space overlaps between different
When acting as a forward proxy server, url-string can also be used to specify remote sites and proxy protocols which caching should be enabled for.
The no-cache environment variable can be set to
disable caching on a finer grained set of resources in versions
2.2.12 and later.
The
The no-cache environment variable can be set to
disable caching on a finer grained set of resources in versions
2.2.12 and later.
The
The
The
Ordinarily, documents without a last-modified date are not cached.
Under some circumstances the last-modified date is removed (during
Ordinarily, requests containing a Cache-Control: no-cache or
Pragma: no-cache header value will not be served from the cache. The
Ordinarily, requests with query string parameters are cached separately
for each unique query string. This is according to RFC 2616/13.9 done only
if an expiration time is specified. The
In the event that a document does not provide an expiry date but does
provide a last-modified date, an expiry date can be calculated based on
the time since the document was last modified. The
expiry-period = time-since-last-modified-date * factor
expiry-date = current-date + expiry-period
For example, if the document was last modified 10 hours ago, and
factor is 0.1 then the expiry-period will be set to
10*0.1 = 1 hour. If the current time was 3:00pm then the computed
expiry-date would be 3:00pm + 1hour = 4:00pm.
If the expiry-period would be longer than that set by
According to RFC 2616, hop-by-hop HTTP headers are not stored in
the cache. The following HTTP headers are hop-by-hop headers and thus
do not get stored in the cache in any case regardless of the
setting of
ConnectionKeep-AliveProxy-AuthenticateProxy-AuthorizationTETrailersTransfer-EncodingUpgradeNone.
Expires which are needed for proper cache
management are not stored due to a
Sometimes applications encode the session identifier into the URL like in the following Examples:
/someapplication/image.gif;jsessionid=123456789/someapplication/image.gif?PHPSESSIONID=12345678This causes cachable resources to be stored separately for each session, which
is often not desired.
CacheIgnoreURLSessionIdentifiers None clears the list of ignored
identifiers. Otherwise, each identifier is added to the list.
Ordinarily, responses with Cache-Control: private header values will not
be stored in the cache. The
Ordinarily, requests or responses with Cache-Control: no-store header
values will not be stored in the cache. The
The
In a minimal configuration the following directive is all that is needed to enable the thundering herd lock in the default system temp directory.
The
The
A lock older than this value in seconds will be ignored, and the next incoming request will be given the opportunity to re-establish the lock. This mechanism prevents a slow client taking an excessively long time to refresh an entity.