#include "rewrite_driver.h"
Subclass of HTTPCache::Callback that incorporates a given RewriteOptions' invalidation policy.
net_instaweb::OptionsAwareHTTPCacheCallback::OptionsAwareHTTPCacheCallback |
( |
const RewriteOptions * |
rewrite_options, |
|
|
const RequestContextPtr & |
request_ctx |
|
) |
| |
|
protected |
Sub-classes need to ensure that rewrite_options remains valid till Callback::Done finishes.
A method that allows client Callbacks to apply invalidation checks. We first (in http_cache.cc) check whether the entry is expired using normal http semantics, and if it is not expired, then this check is called – thus callbacks can apply any further invalidation semantics it wants on otherwise valid entries. But there's no way for a callback to override when the HTTP semantics say the entry is expired.
See also OptionsAwareHTTPCacheCallback in rewrite_driver.h for an implementation you probably want to use.
Reimplemented from net_instaweb::HTTPCache::Callback.
Validates the specified response for the URL, request, given the specified options. This is for checking if cache response can still be used, not for determining whether an entry should be written to an HTTP cache.
virtual int64 net_instaweb::OptionsAwareHTTPCacheCallback::OverrideCacheTtlMs |
( |
const GoogleString & |
key | ) |
|
|
virtual |
Overrides the cache ttl of the cached response with the given value. Note that this has no effect if the returned value is negative or less than the cache ttl of the stored value.
Reimplemented from net_instaweb::HTTPCache::Callback.
virtual ResponseHeaders::VaryOption net_instaweb::OptionsAwareHTTPCacheCallback::RespectVaryOnResources |
( |
| ) |
const |
|
virtual |
Determines whether this Get request was made in the context where arbitrary Vary headers should be respected.
Note that Vary:Accept-Encoding is ignored at this level independent of this setting, and Vary:Cookie is always respected independent of this setting. Vary:Cookie prevents cacheing resources. For HTML, however, we can cache Vary:Cookie responses as long as there is no cookie in the request.
Implements net_instaweb::HTTPCache::Callback.
The documentation for this class was generated from the following file: