Page Speed Optimization Libraries
1.5.27.2
|
#include "rewrite_driver.h"
Public Member Functions | |
virtual bool | IsCacheValid (const GoogleString &key, const ResponseHeaders &headers) |
virtual int64 | OverrideCacheTtlMs (const GoogleString &key) |
Protected Member Functions | |
OptionsAwareHTTPCacheCallback (const RewriteOptions *rewrite_options, const RequestContextPtr &request_ctx) |
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.
virtual bool net_instaweb::OptionsAwareHTTPCacheCallback::IsCacheValid | ( | const GoogleString & | key, |
const ResponseHeaders & | headers | ||
) | [virtual] |
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.
Implements net_instaweb::HTTPCache::Callback.
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.