Page Speed Optimization Libraries  1.4.26.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions
net_instaweb::OptionsAwareHTTPCacheCallback Class Reference

#include "rewrite_driver.h"

Inheritance diagram for net_instaweb::OptionsAwareHTTPCacheCallback:
net_instaweb::HTTPCache::Callback

List of all members.

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)

Detailed Description

Subclass of HTTPCache::Callback that incorporates a given RewriteOptions' invalidation policy.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines