net_instaweb::HTTPCache::Callback Class Reference

#include "http_cache.h"

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

List of all members.

Public Member Functions

virtual void Done (FindResult find_result)=0
virtual bool IsCacheValid (const ResponseHeaders &headers)=0
virtual bool IsFresh (const ResponseHeaders &headers)
HTTPValuehttp_value ()
ResponseHeadersresponse_headers ()
const ResponseHeadersresponse_headers () const
void set_response_headers (ResponseHeaders *headers)
HTTPValuefallback_http_value ()
void set_timing_info (TimingInfo *timing_info)
virtual TimingInfo * timing_info ()
virtual void SetTimingMs (int64 timing_value_ms)

Detailed Description

Class to handle an asynchronous cache lookup response.

Todo:
TODO(jmarantz): consider inheriting from AsyncFetch with an implementation of Write/Flush/HeadersComplete -- we'd have to make Done take true/false so this would impact callers.

Member Function Documentation

HTTPValue* net_instaweb::HTTPCache::Callback::http_value (  )  [inline]
Todo:
TODO(jmarantz): specify the dataflow between http_value and response_headers.
virtual bool net_instaweb::HTTPCache::Callback::IsCacheValid ( const ResponseHeaders headers  )  [pure 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.

Implemented in net_instaweb::OptionsAwareHTTPCacheCallback.

virtual bool net_instaweb::HTTPCache::Callback::IsFresh ( const ResponseHeaders headers  )  [inline, virtual]

A method that allows client Callbacks to check if the response in cache is fresh enough, in addition to it being valid. This is used while freshening resources to check that the response in cache is not only valid, but is also not going to expire anytime soon. Note that if the response in cache is valid but not fresh, the HTTPCache calls Callback::Done with find_result = kNotFound and fills in fallback_http_value() with the cached response.

void net_instaweb::HTTPCache::Callback::set_timing_info ( TimingInfo *  timing_info  ) 

Sets the TimingInfo to the specified pointer. The caller must guarantee that the pointed-to TimingInfo remains valid as long as the HTTPCache is running.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:33:53 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3