net_instaweb::CacheUrlAsyncFetcher Class Reference

#include "cache_url_async_fetcher.h"

Inheritance diagram for net_instaweb::CacheUrlAsyncFetcher:
net_instaweb::UrlAsyncFetcher

List of all members.

Public Member Functions

 CacheUrlAsyncFetcher (HTTPCache *cache, UrlAsyncFetcher *fetcher)
virtual bool SupportsHttps () const
virtual bool Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *base_fetch)
HTTPCachehttp_cache () const
UrlAsyncFetcherfetcher () const
void set_backend_first_byte_latency_histogram (Histogram *x)
Histogrambackend_first_byte_latency_histogram () const
void set_fallback_responses_served (Variable *x)
Variablefallback_responses_served () const
void set_num_conditional_refreshes (Variable *x)
Variablenum_conditional_refreshes () const
void set_respect_vary (bool x)
bool respect_vary () const
void set_ignore_recent_fetch_failed (bool x)
bool ignore_recent_fetch_failed () const
void set_serve_stale_if_fetch_error (bool x)
bool serve_stale_if_fetch_error () const
void set_default_cache_html (bool x)
bool default_cache_html () const

Detailed Description

Composes an asynchronous URL fetcher with an http cache, to generate an asynchronous caching URL fetcher.

This fetcher will asynchronously check the cache. If the url is found in cache and is still valid, the fetch's callback will be called right away. Otherwise an async fetch will be performed in the fetcher, the result of which will be written into the cache. In case the fetch fails and there is a stale response in the cache, we serve the stale response.

Todo:
TODO(sligocki): In order to use this for fetching resources for rewriting we'd need to integrate resource locking in this class. Do we want that?

Member Function Documentation

virtual bool net_instaweb::CacheUrlAsyncFetcher::Fetch ( const GoogleString url,
MessageHandler message_handler,
AsyncFetch fetch 
) [virtual]

Fetch with AsyncFetch interface.

Default implementation uses StreamingFetch method and calls HeadersComplete right before the first call to Write, Flush or Done.

Future implementations ought to call HeadersComplete directly.

Return value is the same as StreamingFetch. (Returns true iff callback has already been called by the time Fetch returns.)

Todo:
TODO(sligocki): Stick all other params into AsyncFetch object (url, request_headers, response_headers, message_handler).

Reimplemented from net_instaweb::UrlAsyncFetcher.

virtual bool net_instaweb::CacheUrlAsyncFetcher::SupportsHttps (  )  const [inline, virtual]

Determine if the fetcher supports fetching using HTTPS. By default we assume a fetcher can.

Reimplemented from net_instaweb::UrlAsyncFetcher.


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:52 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3